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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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