全部!在我将我的 solr 版本更新到 4.1 后,重建索引时出现这样的错误:
Warning: Error creating document : SolrInputDocument[dop_pos_state=, dop_country=, dop_first_name_onlySort=Rick, dop_first_name=Rick, dop_sync_flag=true, dop_orgid=1522402, dop_last_name=King, dop_last_name_onlySort=King, dop_invite_flag=true, dop_name=Rick King, dop_metro_area=, dop_create_date=2012-12-15 08:53:55.0, dop_address=Greater Boston Area, dop_job_level=1, dop_id=343218, dop_title=at A & J Engineering Inc., dop_update_date=2013-02-19 09:38:38.0, dop_metromap_id=210, dop_facebook_linked=0, dop_linkedin_linked=0, dop_crunchBase_linked=0, dop_twitter_linked=0]
java.lang.IllegalArgumentException: first position increment must be > 0 (got 0)
at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:125)
at org.apache.lucene.index.DocFieldProcessor.processDocument(DocFieldProcessor.java:306)
at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:250)
at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:376)
当我删除 schema.xml 中的字段 dop_title (即“在 A & J Engineering Corp.”)时,它工作正常。dop_title 的分析器如下:
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldType>
然后我放入solr的分析页面,结果是:
这是怎么发生的,我可以通过什么方式避免这种情况?谢谢你的帮助!