# Filter on a list of values

**URL:** <https://discuss.elastic.co/t/filter-on-a-list-of-values/207998>\
**Category:** Elasticsearch\
**Created:** [November 15, 2019, 6:28am UTC](https://discuss.elastic.co/t/filter-on-a-list-of-values/207998 "2019-11-15T06:28:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashish1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashish1/32/45475_2.png) [@Ashish1](https://discuss.elastic.co/u/Ashish1)\
**Post date:** [November 15, 2019, 6:28am UTC](https://discuss.elastic.co/t/filter-on-a-list-of-values/207998/1 "2019-11-15T06:28:49Z")

</div>

I want to filter documents from a list of values.  
Say, i have an index which contains a field "customer\_id".  
I have a list of customer\_ids to lookup from the above index and the list is around 10000 ids.  
Is there any efficient way to index these ids somewhere and use them in the query ?  
I am skeptical about sending such huge bunch of ids every time i want to filter them in the query.

Please let me know if you have come across such situation.  
Thanks!

---

<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:** [December 13, 2019, 6:28am UTC](https://discuss.elastic.co/t/filter-on-a-list-of-values/207998/2 "2019-12-13T06:28:52Z")

</div>

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