Question

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?

Was it helpful?

Solution

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top