Exception writing document id to the index; possible analysis error

假如想象 提交于 2019-12-01 07:00:44
Eric Thomas

I am going to piggy back off this question because it is one of the first ones that comes up when looking for this issue and there are no general answers.

I was getting the same problem when trying to use the update API to add a document using a json. Come to find out one of my fields in solr was not formatted correctly as I was trying to save an XML string into a string field. I had to change the field to text_general.

The error is basically saying that what you are entering might not fit with your schema. Check each of your fields by adding them to the update 1 at a time. Then change as necessary.

I need to create a separate field types for EdgeNGramFilterFactory and normal suggest.

  <field name="my_suggest" type="my_suggest_field" indexed="true" stored="false"/>
  <field name="my_suggest_ngram" type="my_suggest_ngram_field" indexed="true" stored="false"/>

  <fieldType name="my_suggest_field" class="solr.TextField" positionIncrementGap="100">
    <analyzer type="index">
        <filter class="solr.LowerCaseFilterFactory" />
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory" />
        <filter class="solr.LowerCaseFilterFactory" />
    </analyzer>
  </fieldType>

  <fieldType name="my_suggest_ngram_field" class="solr.TextField" positionIncrementGap="100">
        <analyzer type="index">
            <filter class="solr.LowerCaseFilterFactory" />
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="10"/>
        </analyzer>
        <analyzer type="query">
            <tokenizer class="solr.StandardTokenizerFactory" />
            <filter class="solr.LowerCaseFilterFactory" />
        </analyzer>
  </fieldType>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!