I’m referring to the Solr Search Query API documentation and try to write own custom Solr queries. This works fine so far.
I’d also like to include highlighting of found keywords in the reponse snippets, as the regular Solr Search does. If I set
#set ($discard = $query.bindValue('hl', 'true'))
the response displayed by
#displaySearchResult($searchResult)
will indeed deliver the relevant text snippets, but without emphasizing the searched term (in the standard Solr Search, it’s bold) and including a lot of fields which I would not all want to see, e.g. “Rendered document content” as well as “Raw document content”, which is mostly redundant (in standard Solr Search, only “Rendered document content” is shown).
I assume I should probably assign some other parameters like ‘fl’, ‘hl.fl’ etc. (as mentioned in the documentation) but how to do that isn’t exactly clear from the XWiki documentation, while the Solr documentation is extensive but uses a more general query syntax and I’m not clear how to translate this into Velocity commands. Tried dozens of variations, all refusing to work. Is it at all possible to influence the highlighting response display from this API? Any help very appreciated.