Solr仅在搜索词大写时获取结果
我对Solr搜索有以下问题 当我搜索以Solr仅在搜索词大写时获取结果,solr,token,Solr,Token,我对Solr搜索有以下问题 当我搜索以“oe”、“ae”或“ue”(德语中与ö、ä和ü相同)开头的单词,并且搜索词未大写时,Solr返回0个结果 但是,当我搜索同一个单词时,如果该单词的第一个字符大写,我会从Solr得到结果 当我在调试模式下执行搜索时,我看到非大写搜索词总是从例如“ue”->“u”转换而来 编制索引时,使用以下过滤器: <fieldType name="text" class="solr.TextField" sortMissingLast="tr
“oe”、“ae”或“ue”(德语中与ö、ä和ü相同)开头的单词,并且搜索词未大写时,Solr返回0个结果
但是,当我搜索同一个单词时,如果该单词的第一个字符大写,我会从Solr得到结果
当我在调试模式下执行搜索时,我看到非大写搜索词总是从例如“ue”->“u”转换而来
编制索引时,使用以下过滤器:
<fieldType name="text" class="solr.TextField" sortMissingLast="true" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords-de.txt" /> <!-- DE -->
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" splitOnCaseChange="0" splitOnNumerics="0" catenateWords="1" catenateNumbers="0" catenateAll="1" stemEnglishPossessive="1" preserveOriginal="1" />
<filter class="solr.GermanNormalizationFilterFactory" /> <!-- DE -->
<filter class="solr.ASCIIFoldingFilterFactory" /> <!-- DE -->
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" catenateAll="1" preserveOriginal="1" />
</analyzer>
</fieldType>
有人知道如何避免这种转换吗?
感谢您的帮助 是的,这是根据您的配置预期的行为,因为GermanNormalizationFilterFactory
执行以下操作:
'ß' is replaced by 'ss'
'ä', 'ö', 'ü' are replaced by 'a', 'o', 'u', respectively.
'ae' and 'oe' are replaced by 'a', and 'o', respectively.
'ue' is replaced by 'u', when not following a vowel or q.
因此,您可以删除它,ue
将不会被替换为u
。另一种可能有帮助的方法(我不确定,我完全了解您的用例)是将
放在GermanNormalizationFilterFactory
'ß' is replaced by 'ss'
'ä', 'ö', 'ü' are replaced by 'a', 'o', 'u', respectively.
'ae' and 'oe' are replaced by 'a', and 'o', respectively.
'ue' is replaced by 'u', when not following a vowel or q.