# Querystring LUCENE Query limitations and performance

**URL:** <https://discuss.elastic.co/t/querystring-lucene-query-limitations-and-performance/46003>\
**Category:** Elasticsearch\
**Created:** [April 1, 2016, 12:32am UTC](https://discuss.elastic.co/t/querystring-lucene-query-limitations-and-performance/46003 "2016-04-01T00:32:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthik\_Ramachandran](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@Karthik\_Ramachandran](https://discuss.elastic.co/u/Karthik_Ramachandran)\
**Post date:** [April 1, 2016, 12:32am UTC](https://discuss.elastic.co/t/querystring-lucene-query-limitations-and-performance/46003/1 "2016-04-01T00:32:47Z")

</div>

Hi All,

Is there any limitation on maximum number of bool clauses in a query (AND/OR). I believe it is 1024 and can be set in cluster configuration? But can someone clarify!

Also, what is the performance impact of a query that has so many clauses \>=1024. I have few of them and trying to find how do I decide on cluster scale/settings early. The queries do query more than 40 indexes that keeps data for around 1 year. The volume I'm looking is close to 3-4 Billions. It is a aggregate query viz. Filter + Search.

My current plan is to do some delay loading viz. Query indexes from latest to old and slowly change graphs...regardless, my concern is 1024+ clauses in querystring LUCENE query..

---

<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 5, 2017, 11:03pm UTC](https://discuss.elastic.co/t/querystring-lucene-query-limitations-and-performance/46003/2 "2017-07-05T23:03:28Z")

</div>


