我目前正在将Solr作为网上商店的搜索引擎实施。大多数产品都被发现,但有一种情况给我带来了问题:
我有以下字段:
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
splitOnCaseChange="1" splitOnNumerics="1"
generateWordParts="1" generateNumberParts="1"
catenateWords="1" catenateNumbers="1" catenateAll="1"
preserveOriginal="1"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.LengthFilterFactory" min="2" max="60"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
splitOnCaseChange="1" splitOnNumerics="1"
generateWordParts="0" generateNumberParts="0"
catenateWords="1" catenateNumbers="1" catenateAll="1"
preserveOriginal="1"
/>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.LengthFilterFactory" min="2" max="60"/>
</analyzer>
</fieldType>
我在这个字段上索引以下文字:panasonic hc-v500
我搜索以下术语:v500。查询类型为Dismax,最小匹配设置为1。
期望的结果:找到文件
结果:找不到文档
很自然地,我使用了优秀的“场分析”工具。这给了我以下结果:
我的问题:
在这种情况下,有没有办法让Solr索引为“v500”?
字段分析结果给我的印象是文档匹配('500'),但未返回。怎么解释这个?
我的explainQuery的debugQuery返回了以下结果:
0.0 = (NON-MATCH) Failure to meet condition(s) of required/prohibited clause(s)
0.0 = no match on required clause (products_model:"v500 (500 v500)")
0.0 = (NON-MATCH) weight(products_model:"v500 (500 v500)" in 20538), product of:
0.99999994 = queryWeight(products_model:"v500 (500 v500)"), product of:
26.309225 = idf(products_model: v500=2 500=76 v500=2)
0.03800948 = queryNorm
0.0 = (NON-MATCH) fieldWeight(products_model:"v500 (500 v500)" in 20538), product of:
0.0 = tf(phraseFreq=0.0)
26.309225 = idf(products_model: v500=2 500=76 v500=2)
0.5 = fieldNorm(field=products_model, doc=20538)
答案 0 :(得分:0)
splitOnNumerics="0"
Add ability to optionally splitOnNumerics WordDelimiterFilter/Factory