Hi everyone!

Does anyone have any good examples of generating a contiguous highlight for
a phrase? Here's what I have done:

curl http://localhost/solr/collection1/update?commit=true -H "Content-Type:
text/xml" --data-binary '<add><doc><field name="id">100</field><field
name="content">blah blah blah knowledge of science blah blah
blah</field></doc></add>'

Then, using a browser:

http://localhost/solr/collection1/select?q="knowledge+of+science"&fq=id:100

What I get back in highlighting is:
<str>blah blah blah <b>knowledge</b> <b>of</b> <b>science</b> blah blah
blah</str>

What I want to get back is:
<str>blah blah blah <b>knowledge of science</b> blah blah blah</str>

I have the following highlighting configurations in my requestHandler in
addition to hl, hl.fl, etc.:
<str name="hl.mergeContiguous">false</str>
<str name="usePhraseHighlighter">true</str>
<str name-"highlightMultiTerm">true</str>
None of the last two seemed to have any impact on the output. I've tried
every permutation of those three, but the output is the same. Any
suggestions or examples of getting highlights to come back this way? I'd
appreciate any advice on this! Thanks!

-Teague



Reply via email to