Solr 无法索引文本字段

问题描述 投票:0回答:2

尝试使用

text_general
字段索引文档时,出现以下错误:

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

我尝试索引的文档如下所示:

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

该字段的架构定义是:

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

字段类型定义为:

<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>

如何成功索引具有

text_general
字段的文档?

solr lucene full-text-search
2个回答
8
投票

这是由于已经为使用不同字段类型索引的字段建立了索引的内容造成的。删除索引并重新索引您的内容。


0
投票

我们正在使用 Sitcore Managed Cloud 和 SearchStax for Solr,但我收到了此错误。我登录到 Solr Admin 并转到左侧导航菜单中的“Collections”。从那里我选择了在重建时出现错误的集合,然后单击“重新加载”。重新加载集合后,我能够成功重建。不确定这是否对其他人有帮助。

Screenshot

© www.soinside.com 2019 - 2024. All rights reserved.