1

I have a situation in which I have a list of words and I want to match them with a specific document field.

Suppose I have list [apple, orange, mango] and have document in which I have apple is a good food as compared to mango now I want my search query should return apple and mango because they exist/match with the document.

Is there any built-in function or any way I can do that could be pragmatically or using query ?

Root
  • 955
  • 1
  • 16
  • 39
  • 1
    Possible duplicate of [How can I tell Solr to return the hit search terms per document?](https://stackoverflow.com/questions/25038080/how-can-i-tell-solr-to-return-the-hit-search-terms-per-document) – MatsLindh Oct 04 '18 at 20:19

1 Answers1

0

You might be able to get this information by turning hit highlighting in your query and looking at the highlighting information in the response. It won't be a one-to-one match as the highlighting information considers stemming and you might see variations of the words that you searched for (e.g. apples instead of apple, or running instead of run) but this might get you somewhat close to what you are looking for.

Hector Correa
  • 26,290
  • 8
  • 57
  • 73