Solr 无法索引文本字段
Solr fails to index text field
尝试使用 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
字段成功索引文档?
这是因为已经为使用不同字段类型编制索引的字段编制了内容索引。删除索引并重新索引您的内容。
尝试使用 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
字段成功索引文档?
这是因为已经为使用不同字段类型编制索引的字段编制了内容索引。删除索引并重新索引您的内容。