lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Teague James" <>
Subject Contiguous Phrase Highlighting Example
Date Thu, 17 Jul 2014 18:19:48 GMT
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

Then, using a browser:


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

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!


View raw message