solr 4.1 java.lang.IllegalArgumentException:第一个位置增量必须是> 0(得0)

时间:2013-02-20 02:43:43

标签: search solr indexing

一切! 将我的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的分析页面,结果是: enter image description here

这是怎么发生的,我可以通过哪种方式避免这种情况?谢谢你的帮助!

1 个答案:

答案 0 :(得分:1)

正在进行从基于流的处理到基于图形的令牌处理的持续迁移。这在Solr 4.1中发现了一些奇怪的边缘情况。看起来你的是其中之一(回归)。如果您愿意,可以打开an issue,然后有人会查看它。

同时,您可能会发现,如果您勾选分析页面右侧的“详细输出”按钮,它会显示有关管道中每个步骤的更多信息,包括位置值。这可以帮助您更快地调试此问题和/或帮助避免它。