Take the 2-minute tour ×

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

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

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

share|improve this answer
add comment

Your Answer


