Solr 无法索引文本字段

Phi*_*ipp 7 lucene solr full-text-search

当尝试使用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
Run Code Online (Sandbox Code Playgroud)

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

{
    "filename": "FooBar.pdf",
    "content": "my test"
}
Run Code Online (Sandbox Code Playgroud)

该字段的架构定义是:

  <field name="content" type="text_general" uninvertible="true" indexed="true" required="true" stored="true"/>
Run Code Online (Sandbox Code Playgroud)

字段类型定义为:

<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>
Run Code Online (Sandbox Code Playgroud)

如何成功地使用字段索引文档text_general

Mat*_*ndh 12

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