Philipp
Philipp

Reputation: 916

Solr fails to index text field

When trying to index documents with text_general fields I get the following error:

Exception writing document id 93cf6aeb-54b0-471a-9325-5b8e95801131 to the index; possible analysis error: cannot change field "content" from index options=DOCS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS

The document I attempted to index looks as follows:

{
    "filename": "FooBar.pdf",
    "content": "my test"
}

The schema definition for this field is:

  <field name="content" type="text_general" uninvertible="true" indexed="true" required="true" stored="true"/>

With the field type defined as:

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
    <analyzer type="index">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
    <analyzer type="query">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
      <filter class="solr.SynonymGraphFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
</fieldType>

How do I succcessfully index a document with a text_general field?

Upvotes: 9

Views: 8392

Answers (2)

Jabare Mitchell
Jabare Mitchell

Reputation: 21

We're using Sitcore Managed Cloud with SearchStax for Solr and I got this error. I logged into the Solr Admin and went to "Collections" in the left nav menu. From there I chose the collection that gave the error on Rebuild and clicked "Reload". After reloading the collection, I was able to rebuild successfully. Not sure if this will help anyone else.

Screenshot

Upvotes: 2

MatsLindh
MatsLindh

Reputation: 52912

This is caused by there already being content indexed for the field that was indexed with a different field type. Delete the index and re-index your content.

Upvotes: 14

Related Questions