# Java api: terms query with a big amount of terms

**URL:** <https://discuss.elastic.co/t/java-api-terms-query-with-a-big-amount-of-terms/74341>\
**Category:** Elasticsearch\
**Created:** [February 8, 2017, 8:35am UTC](https://discuss.elastic.co/t/java-api-terms-query-with-a-big-amount-of-terms/74341 "2017-02-08T08:35:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilangra](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@ilangra](https://discuss.elastic.co/u/ilangra)\
**Post date:** [February 8, 2017, 8:35am UTC](https://discuss.elastic.co/t/java-api-terms-query-with-a-big-amount-of-terms/74341/1 "2017-02-08T08:35:47Z")

</div>

Hi,

I want to make a query with an input of 1000000 terms.  
Is it possible?

I tried with 150k, it is ok, but more than that, i got out of memory error.  
It may due to my environment?

What should I do?

Thank you.

Ilan

---

<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:** [March 8, 2017, 8:36am UTC](https://discuss.elastic.co/t/java-api-terms-query-with-a-big-amount-of-terms/74341/2 "2017-03-08T08:36:01Z")

</div>

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