我是solr并创建自动提供核心的新手。该功能在以下schenario
中不起作用http://XXXXXXX:8080/solr/autosuggest/select?q= SPF 20 & debugQuery = true
我的schema.xml文件配置如下
<field name="NameSuggest" type="whole_text_suggest" indexed="true" stored="true" omitNorms="true" />
<fieldType name="whole_text_suggest" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1"
generateNumberParts="1"
catenateWords="1"
catenateNumbers="1"
catenateAll="1"
splitOnCaseChange="1"
splitOnNumerics="1"
preserveOriginal="1"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" replacement=" " replace="all"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="0"
generateNumberParts="0"
catenateWords="0"
catenateNumbers="0"
catenateAll="0"
splitOnCaseChange="0"
splitOnNumerics="0"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" replacement=" " replace="all"/>
</analyzer>
</fieldType>
我观察到数字数字“20”在查看时忽略并仅搜索 SPF
<lst name="debug">
<str name="rawquerystring">SPF 20</str>
<str name="querystring">SPF 20</str>
<str name="parsedquery">NameSuggest:spf NameSuggest:</str>
<str name="parsedquery_toString">NameSuggest:spf NameSuggest:</str>
请注意: q = SPF20 (没有空格)正在按预期工作
请帮我解决此问题:)
感谢。 巴布