Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr highlighting of multiple terms

I have configured Solr so that the terms I'm searching are highlighted, but if those terms are far between them, I will only see the first one in the highlighting snippet.

What I want is to have something similar to Google's: separating snippets with an "ellipse" (...) so I can see the multiple terms in their context at once.

Is it possible?

like image 676
David Morales Avatar asked Oct 25 '10 13:10

David Morales


1 Answers

You're looking for the hl.snippets parameter. It defaults to 1, and determines how many (maximum) snippets each highlighted field returns in each document.

See http://wiki.apache.org/solr/HighlightingParameters#hl.snippets

like image 134
Karl Johansson Avatar answered Oct 15 '22 20:10

Karl Johansson