# Large terms query slow

**URL:** <https://discuss.elastic.co/t/large-terms-query-slow/69221>\
**Category:** Elasticsearch\
**Created:** [December 15, 2016, 10:24pm UTC](https://discuss.elastic.co/t/large-terms-query-slow/69221 "2016-12-15T22:24:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcollinsworth](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@tcollinsworth](https://discuss.elastic.co/u/tcollinsworth)\
**Post date:** [December 15, 2016, 10:24pm UTC](https://discuss.elastic.co/t/large-terms-query-slow/69221/1 "2016-12-15T22:24:45Z")

</div>

Is there some mechanism to pass large filter lists at query time?

We found that we can send 35K boolean clauses in Solr and return results in under 1 sec.  
We're trying to move our search to elasticsearch, but a terms query with far less 100s of values is already too slow in the 3 sec range.  
We need to send large lists of filter IDs for entitlements. Our use case requires this because the lists vary substantially by organization and groups and even users, so there aren't static logical groups that could be used. It would require reindexing large full text documents every time they change.  
Since both elasticsearch and Solr use Lucene we expected the performance to be comparable, but it isn't even close.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 16, 2016, 7:33pm UTC](https://discuss.elastic.co/t/large-terms-query-slow/69221/2 "2016-12-16T19:33:34Z")

</div>

Maybe fixed by

> <https://github.com/elastic/elasticsearch/pull/21776>

thought is it hard to say without looking at something like hot\_threads.

---

<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 13, 2017, 7:33pm UTC](https://discuss.elastic.co/t/large-terms-query-slow/69221/3 "2017-01-13T19:33:39Z")

</div>

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