# Search by 'all values from a document must be contained in query'

**URL:** <https://discuss.elastic.co/t/search-by-all-values-from-a-document-must-be-contained-in-query/23348>\
**Category:** Elasticsearch\
**Created:** [April 21, 2015, 4:31pm UTC](https://discuss.elastic.co/t/search-by-all-values-from-a-document-must-be-contained-in-query/23348 "2015-04-21T16:31:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_Melentiev](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Max\_Melentiev](https://discuss.elastic.co/u/Max_Melentiev)\
**Post date:** [April 21, 2015, 4:31pm UTC](https://discuss.elastic.co/t/search-by-all-values-from-a-document-must-be-contained-in-query/23348/1 "2015-04-21T16:31:20Z")

</div>

Hi!

I'm indexing documents with list of required features (int[] A). And then I  
want to filter docs by the list of available features (int[] B). So that  
all required features must be in a list of available (A & B = A).

I haven't found any appropriate filter for this and understand that this  
problem is hard to solve with inverted index.  
I wonder if there any tricky way to do it? Maybe its possible to set  
minimum\_should\_match of bool filter to the number of required features  
(A.lenght) or something else.

Any thoughts will be helpful.

Thanks!  
Max

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cbea8916-12e0-4ae4-bc4c-577259fc9185%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cbea8916-12e0-4ae4-bc4c-577259fc9185%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:18am UTC](https://discuss.elastic.co/t/search-by-all-values-from-a-document-must-be-contained-in-query/23348/2 "2017-07-06T00:18:32Z")

</div>

Closed on July 6, 2017, 12:18am UTC


