I’m working with Solr and need to extract the first sentence that matches the query along with its highlighted snippet and surrounding sentences. How can I achieve this using Solr?
Lets take this whole highlighted input:
Some sentence. First sentence before highlighting. Sentence with <em>HighlightedTerm</em>. Sentence after the highlighting. Some sentence. Another Sentence with <em>HighlightedTerm</em>
Expected output:
First sentence before highlighting. Sentence with <em>HighlightedTerm</em>. Sentence after the highlighting.
The only idea I had was to get the whole text with highlits from solr and tokenize the text by sentences and choose what I need. But I am wondering if solr API supports this what I need to some extent.