我的 solr 设置有问题。它没有在选择处理程序中搜索“canaDa”,因为它是“canada”。
这是 fieldtype 的架构text_en_splitting
(它们都很重要):
<fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" enablePositionIncrements="true"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" />
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" enablePositionIncrements="true" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" preserveOriginal="1" />
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
.
这是选择处理程序的 solrconfig 设置:
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">20</int>
<str name="df">text</str>
<str name="defType">edismax</str>
<str name="qf">court_id^0.1 jurisdiction^1.0 jur_code^0.5 court_name^1.5 court_code^0.5 court_type^1.0</str>
<str name="mm">80%</str>
<str name="q.alt">*:*</str>
<str name="fl">*</str>
</lst>
.
这是 solr admin 的查询分析工具: .
如您所见,查询分析确实将其破坏为“canaDa”,但搜索找不到它......