# Multiple words search using closed list

**URL:** <https://discuss.elastic.co/t/multiple-words-search-using-closed-list/184956>\
**Category:** Elasticsearch\
**Created:** [June 10, 2019, 9:22am UTC](https://discuss.elastic.co/t/multiple-words-search-using-closed-list/184956 "2019-06-10T09:22:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yarivkohn](https://avatars.discourse-cdn.com/v4/letter/y/e99b99/32.png) [@yarivkohn](https://discuss.elastic.co/u/yarivkohn)\
**Post date:** [June 10, 2019, 9:22am UTC](https://discuss.elastic.co/t/multiple-words-search-using-closed-list/184956/1 "2019-06-10T09:22:23Z")

</div>

Hi,  
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.

For example:

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

Valid results are:  
'this is my list'  
'this is my list of words'  
'list',  
'my list'  
etc.

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)  
etc.

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

Thanks,  
Yariv.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 8, 2019, 9:22am UTC](https://discuss.elastic.co/t/multiple-words-search-using-closed-list/184956/2 "2019-07-08T09:22:24Z")

</div>

Closed on July 8, 2019, 9:22am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
