# Max number of values in term query

**URL:** <https://discuss.elastic.co/t/max-number-of-values-in-term-query/9476>\
**Category:** Elasticsearch\
**Created:** [October 26, 2012, 4:49am UTC](https://discuss.elastic.co/t/max-number-of-values-in-term-query/9476 "2012-10-26T04:49:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [October 26, 2012, 4:49am UTC](https://discuss.elastic.co/t/max-number-of-values-in-term-query/9476/1 "2012-10-26T04:49:22Z")

</div>

Hi Shay,  
I need to get all of the document with the given set of ids. and  
the set size is about 2000. if I am trying to send the whole set, its not  
working. Its not picking values more than 1024. Is there any setting which  
can increase this limit, so that i can send all of the ids and get all of  
the documents???

Thanks.

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [October 26, 2012, 8:16am UTC](https://discuss.elastic.co/t/max-number-of-values-in-term-query/9476/2 "2012-10-26T08:16:07Z")

</div>

Hello Narinder,

Do you use the Multi Get API?

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

Because with that, for me it works:

# for i in {1..2000}; do curl -XPUT localhost:9200/test/multi/$i -d

'{"foo":"bar'"$i"'"}'; done

# ARRAY="["; for i in {1..1999}; do ARRAY="$ARRAY"$i", "; done;

ARRAY="$ARRAY"$(($i+1))"]";curl  
localhost:9200/test/multi/\_mget?pretty=true -d '{"ids":'"$ARRAY"'}'

And it prints out all the documents, as far as I can see.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Fri, Oct 26, 2012 at 7:49 AM, Narinder Kaur [narinder.kaur@izap.in](mailto:narinder.kaur@izap.in) wrote:

> Hi Shay,  
> I need to get all of the document with the given set of ids. and  
> the set size is about 2000. if I am trying to send the whole set, its not  
> working. Its not picking values more than 1024. Is there any setting which  
> can increase this limit, so that i can send all of the ids and get all of  
> the documents???
> 
> Thanks.
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [October 26, 2012, 10:41am UTC](https://discuss.elastic.co/t/max-number-of-values-in-term-query/9476/3 "2012-10-26T10:41:15Z")

</div>

You can change this limit using "indices.query.bool.max\_clause\_count"  
setting.

On Friday, October 26, 2012 12:49:22 AM UTC-4, Narinder Kaur wrote:

> Hi Shay,  
> I need to get all of the document with the given set of ids.  
> and the set size is about 2000. if I am trying to send the whole set, its  
> not working. Its not picking values more than 1024. Is there any setting  
> which can increase this limit, so that i can send all of the ids and get  
> all of the documents???
> 
> 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:** [July 6, 2017, 3:07am UTC](https://discuss.elastic.co/t/max-number-of-values-in-term-query/9476/4 "2017-07-06T03:07:06Z")

</div>


