2

In Solr, when performing a proximity search, is there a simple way to highlight only the search terms that occur within the specified proximity?

djot
  • 2,952
  • 4
  • 19
  • 28
Ruth
  • 5,646
  • 12
  • 38
  • 45

1 Answers1

4

That depends somehow on the version you are using. At least in Solr3.1 and later there is a way.

Actually i would suggest for this kind of highlighting term vectors with offsets and positions in matters of speed and performance and accuracy.

First of all you start off with enabling TermVectors and Positions + Offsets to accomplish proximity Highlighting on a certain field. The second thing you need is a Highlighting algorithm which works on TermVectors with Offsets. This algorithm is a new feature in Solr3.1 or via contributions available.

Parameters to adjust highlighting may be found here: http://wiki.apache.org/solr/HighlightingParameters Especially the parameters: hl.highlightMultiTerm and hl.usePhraseHighlighter.

See this article for additional information about Term Vector Highlighting Article Reference

There is also a contribution in 2.9.2

fyr
  • 20,227
  • 7
  • 37
  • 53