# Filter for Iterable containing all values

**URL:** <https://discuss.elastic.co/t/filter-for-iterable-containing-all-values/161197>\
**Category:** Elasticsearch\
**Created:** [December 17, 2018, 6:27pm UTC](https://discuss.elastic.co/t/filter-for-iterable-containing-all-values/161197 "2018-12-17T18:27:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoZomIBK](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoZomIBK](https://discuss.elastic.co/u/NoZomIBK)\
**Post date:** [December 17, 2018, 6:27pm UTC](https://discuss.elastic.co/t/filter-for-iterable-containing-all-values/161197/1 "2018-12-17T18:27:26Z")

</div>

Hi,  
I was updating some old java Code from ES 1.4.4 to ES 6.5 and stumbled over some code i do not find a solution in the new version.

I want to filter for documents with an iterable field to contain all given elements. E.g. `tag` may contain an array ["a","b","c"] and the my filter is an array with ["b","c"]. only documents with all given tags should be in the query result.

in the old version it worked with `termsFilterBuilder.execution(TermsFilterParser.EXECUTION_VALUE_AND);` but the filters are gone in 6.5 and part of the queries now. unfortunatly the TermsQueryBuilder does not have anything like the execution method.  
i could not find any alternative, so what would be the best way to do this?

Thanks in advance

---

<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:** [January 14, 2019, 6:27pm UTC](https://discuss.elastic.co/t/filter-for-iterable-containing-all-values/161197/2 "2019-01-14T18:27:30Z")

</div>

Closed on January 14, 2019, 6:27pm UTC

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