[英]Solr dismax highlighting not respecting analyzer
In the schema of Solr 3.6.2 there are two field
declarations, text
and exact
在Solr 3.6.2的模式中,有两个
field
声明, text
和exact
<field name="text" type="text" indexed="true" stored="true" />
<field name="exact" type="string" indexed="true" stored="true" />
The former using StandardTokenizer
and the latter KeywordTokenizer
. 前者使用
StandardTokenizer
,后者使用KeywordTokenizer
。
Solr queries describing the problem: Solr查询描述问题:
?hl=true
&hl.fl=text,exact
&defType=edismax
&qf=text+exact <-------- here
&q=a-b
Highlight output for field exact : <em>a</em>-<em>b</em>
. 高亮显示字段精确输出 :
<em>a</em>-<em>b</em>
。 The problem is the summary for field exact
is produced using the analyzer from text
. 问题是使用
text
分析仪生成的exact
字段摘要。
?hl=true
&hl.fl=text,exact
&defType=edismax
&qf=exact <-------- here
&q=a-b
Highlight output for field exact : <em>ab</em>
. 高亮显示字段精确输出 :
<em>ab</em>
。 By simply removing text
from qf
we get the correct analyzer, why? 通过简单地从
qf
删除text
,我们得到了正确的分析器,为什么?
With debugQuery
on debugQuery
+DisjunctionMaxQuery(((exact:a-b) | ((text:a text:b)~2)))
Solr highlighter after finding a match in exact
also seem to match a
and b
only based on the presence in the query. 找到
exact
匹配的Solr荧光笔似乎也仅根据查询中的存在来匹配a
和b
。 hl.requireFieldMatch=true
does seem to combat that! hl.requireFieldMatch=true
确实可以解决这个问题!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.