Solr 8.0.0 error: cannot change field from index options=DOCS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Solr 8.0.0 error: cannot change field from index options=DOCS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS

Bjarke Buur Mortensen
Hi list,

I'm trying to open a 7.x core in Solr 8.
I'm getting the error:
org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
Error opening new searcher

Digging further in the logs, I see the error:
"
...
Caused by: java.lang.IllegalArgumentException: cannot change field
"delivery_place_code" from index options=DOCS to inconsistent index
options=DOCS_AND_FREQS_AND_POSITIONS
...
"

Is this a known issue when upgrading to 8.0.0?
Can I do anything to avoid it?

Thanks,
Bjarke
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8.0.0 error: cannot change field from index options=DOCS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS

Erick Erickson
I suspect that perhaps some defaults have changed? So I’d try changing the definition in the schema for that field. These changes should be pointed out in the upgrade notes in Lucene or Solr CHANGES.txt.

Best,
Erick

> On May 10, 2019, at 1:17 AM, Bjarke Buur Mortensen <[hidden email]> wrote:
>
> Hi list,
>
> I'm trying to open a 7.x core in Solr 8.
> I'm getting the error:
> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
> Error opening new searcher
>
> Digging further in the logs, I see the error:
> "
> ...
> Caused by: java.lang.IllegalArgumentException: cannot change field
> "delivery_place_code" from index options=DOCS to inconsistent index
> options=DOCS_AND_FREQS_AND_POSITIONS
> ...
> "
>
> Is this a known issue when upgrading to 8.0.0?
> Can I do anything to avoid it?
>
> Thanks,
> Bjarke

Reply | Threaded
Open this post in threaded view
|

Re: Solr 8.0.0 error: cannot change field from index options=DOCS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS

Bjarke Buur Mortensen
OK, so the problem seems to come from
https://issues.apache.org/jira/browse/LUCENE-8134
Our field used to be type="string", but we have since changed it to a text
type to be able to use synonyms (see below).

So we'll still have some documents that were indexed as "string". Am I
right in assuming that we need to reindex in order to upgrade to 8.0.0?

Thanks,
Bjarke

  <fieldType name="nuts_text" class="solr.TextField" sortMissingLast="true"
positionIncrementGap="100">
     <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>  <!-- no
splitting of input -->
        <filter class="solr.UpperCaseFilterFactory" />
      </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.UpperCaseFilterFactory" />
        <filter class="solr.SynonymGraphFilterFactory"
synonyms="nuts-synonyms.txt" ignoreCase="false" expand="true"/>
    </analyzer>
  </fieldType>


Den fre. 10. maj 2019 kl. 22.38 skrev Erick Erickson <
[hidden email]>:

> I suspect that perhaps some defaults have changed? So I’d try changing the
> definition in the schema for that field. These changes should be pointed
> out in the upgrade notes in Lucene or Solr CHANGES.txt.
>
> Best,
> Erick
>
> > On May 10, 2019, at 1:17 AM, Bjarke Buur Mortensen <
> [hidden email]> wrote:
> >
> > Hi list,
> >
> > I'm trying to open a 7.x core in Solr 8.
> > I'm getting the error:
> >
> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
> > Error opening new searcher
> >
> > Digging further in the logs, I see the error:
> > "
> > ...
> > Caused by: java.lang.IllegalArgumentException: cannot change field
> > "delivery_place_code" from index options=DOCS to inconsistent index
> > options=DOCS_AND_FREQS_AND_POSITIONS
> > ...
> > "
> >
> > Is this a known issue when upgrading to 8.0.0?
> > Can I do anything to avoid it?
> >
> > Thanks,
> > Bjarke
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8.0.0 error: cannot change field from index options=DOCS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS

Erick Erickson
Whenever you change a field’s type, reindexing is usually indicated. There are a very few times when it’s not. This really has nothing to do with 8.0, just the fact that you want to change the field’s type.

Do be aware that if the index was _ever_ touched by a 6x version of Lucene, you must re-index to use 8x. But that’s a separate issue from changing a field’s type.

Best,
Erick

> On May 13, 2019, at 2:59 AM, Bjarke Buur Mortensen <[hidden email]> wrote:
>
> OK, so the problem seems to come from
> https://issues.apache.org/jira/browse/LUCENE-8134
> Our field used to be type="string", but we have since changed it to a text
> type to be able to use synonyms (see below).
>
> So we'll still have some documents that were indexed as "string". Am I
> right in assuming that we need to reindex in order to upgrade to 8.0.0?
>
> Thanks,
> Bjarke
>
>  <fieldType name="nuts_text" class="solr.TextField" sortMissingLast="true"
> positionIncrementGap="100">
>     <analyzer>
>        <tokenizer class="solr.KeywordTokenizerFactory"/>  <!-- no
> splitting of input -->
>        <filter class="solr.UpperCaseFilterFactory" />
>      </analyzer>
>    <analyzer type="query">
>        <tokenizer class="solr.KeywordTokenizerFactory"/>
>        <filter class="solr.UpperCaseFilterFactory" />
>        <filter class="solr.SynonymGraphFilterFactory"
> synonyms="nuts-synonyms.txt" ignoreCase="false" expand="true"/>
>    </analyzer>
>  </fieldType>
>
>
> Den fre. 10. maj 2019 kl. 22.38 skrev Erick Erickson <
> [hidden email]>:
>
>> I suspect that perhaps some defaults have changed? So I’d try changing the
>> definition in the schema for that field. These changes should be pointed
>> out in the upgrade notes in Lucene or Solr CHANGES.txt.
>>
>> Best,
>> Erick
>>
>>> On May 10, 2019, at 1:17 AM, Bjarke Buur Mortensen <
>> [hidden email]> wrote:
>>>
>>> Hi list,
>>>
>>> I'm trying to open a 7.x core in Solr 8.
>>> I'm getting the error:
>>>
>> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
>>> Error opening new searcher
>>>
>>> Digging further in the logs, I see the error:
>>> "
>>> ...
>>> Caused by: java.lang.IllegalArgumentException: cannot change field
>>> "delivery_place_code" from index options=DOCS to inconsistent index
>>> options=DOCS_AND_FREQS_AND_POSITIONS
>>> ...
>>> "
>>>
>>> Is this a known issue when upgrading to 8.0.0?
>>> Can I do anything to avoid it?
>>>
>>> Thanks,
>>> Bjarke
>>
>>