문제

In the schema of Solr 3.6.2 there are two field declarations, text and 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.

Solr queries describing the problem:

?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>. The problem is the summary for field exact is produced using the analyzer from text.

?hl=true
&hl.fl=text,exact
&defType=edismax
&qf=exact              <-------- here
&q=a-b

Highlight output for field exact: <em>a-b</em>. By simply removing text from qf we get the correct analyzer, why?

도움이 되었습니까?

해결책

With debugQuery on

+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. hl.requireFieldMatch=true does seem to combat that!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top