0

We would like to search documents under the following rules:

  1. We have a list of words we would like to include in the search
  2. Not all the words in the list must be included in the document
  3. The document MUST NOT contain words which are not in the list.

Our list is: ('this', 'is', 'my', 'list', 'of', 'words')

For example:

1. Valid results are:

  • 'this is my list'
  • 'this is my list of words'
  • 'list'
  • 'my list'

2. Invalid results are:

  • 'this is a given list of words' ('given' was not in the list)
  • 'list of books' ('books' was not in the list)

What would be the correct way to make this search? How can I score the results in case I have more than one?

Thanks,

yariv_kohn
  • 94
  • 4
  • Possible duplicate of [elasticsearch match all words from document in the search query](https://stackoverflow.com/questions/32580295/elasticsearch-match-all-words-from-document-in-the-search-query) – banuj Jun 10 '19 at 12:25
  • Tnx @banuj however this is not what I was looking for. I'm trying to avoid parsing of the results on the backend. I would like to get best hit from Elastic with out any post parsing. – yariv_kohn Jun 10 '19 at 14:21

0 Answers0