Chapter 5. Highlighting Results Using PHP and Solr
One of the advanced functionalities that Solr provides is highlighting the matched keywords in the results returned for a search. In addition to the highlighted matches, it is also possible to specify the number of highlighted snippets that we want Solr to return per field. In this chapter, we will be exploring all the highlighting functionalities of Solr using PHP and the Solarium library. The topics that we will cover are:
Solr highlighting configuration
Highlighting in Solr using PHP and Solarium
Using different highlighting tags for different fields
Highlighting using the fast vector highlighter
Note
The field on which highlighting is required has to be stored in Solr.