0

I'm pretty new to Solr. I was reading the Solr highlighting documentation to discover whether there's a way, in the returned results, to highlight the stems of words that would be returned in an analysis query, but I was not able to find anything in the Solr documentation.

For example, if I use the Solr admin interface to index/query analyze named beetles running management" on the Solr sample field text_en it results in the last filter, the PSF, or PorterStemFilter, changing it to name beetl run manag. I'd like to find a way to query Solr so that it highlights the stems of any found matches.

For example, if my server data contained a phrase

naming beetles running managers

and I queried using the phrase

Named beetles running management

it would return the data in solr, naming beetles running managers but I would like it to return that matching data highlighted:

nameing beetles running managers

because

name beetle run manag

are the stems of the words in my query that match the server data.

GLaDOS
  • 683
  • 1
  • 14
  • 29
  • 1
    unfortunately, you would need to implement custom highlighting in order to do so – Mysterion Jan 02 '19 at 10:43
  • @Mysterion I don't mind implementing custom highlighting plug in ... I couldn't determine whether there's a way to find the stems to which terms were reduced in the solr db itself. – GLaDOS Jan 02 '19 at 20:22
  • I think this task is not trivial, have [a read here](https://medium.com/@sarkaramrit2/tussle-of-highlighting-exact-characters-in-apache-solr-2a48c50dba8c). As soon as you have synonyms any approach to perform partial highlighting comes to an end. – cheffe Jan 04 '19 at 12:47
  • Maybe post processing is an option? You could perform the analysis of the query terms, store the analysed results and highlight within the response or use a JavaScript highlighter. – cheffe Jan 04 '19 at 12:48
  • Definitely not trivial. I think our solution will be to do something like the 3rd comment from @cheffe here. – GLaDOS Jan 07 '19 at 21:03

0 Answers0