获取查询错误:
LNm:"PersonLastName III"
响应是:“字段\"LNm\"在没有位置数据的情况下被编入索引;无法运行 PhraseQuery'
架构是:
<field name="LNm" type="text_general" indexed="true" stored="true"/>
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
最佳答案
这是因为您将 field_type 从 string 更改为 text_general 并且没有执行干净的索引。所以索引器没有必要的位置数据。首先清空你的核心使用
/your_core_name/update?stream.body=<delete><query>*:*</query></delete>&commit=true
然后索引这个核心。
关注:上面的更新代码将删除核心中的所有数据,并且无法撤消!
关于Solr 错误 500 在短语查询中搜索 text_general 字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19574731/