# Span\_multi wildcard query: determining max clause count value

**URL:** <https://discuss.elastic.co/t/span-multi-wildcard-query-determining-max-clause-count-value/227785>\
**Category:** Elasticsearch\
**Created:** [April 13, 2020, 3:06pm UTC](https://discuss.elastic.co/t/span-multi-wildcard-query-determining-max-clause-count-value/227785 "2020-04-13T15:06:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhar](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rhar](https://discuss.elastic.co/u/rhar)\
**Post date:** [April 13, 2020, 3:06pm UTC](https://discuss.elastic.co/t/span-multi-wildcard-query-determining-max-clause-count-value/227785/1 "2020-04-13T15:06:35Z")

</div>

Hi,  
We are hitting the max clause count exceeded exception for the wildcard span\_multi queries. While the exception indicates the clause count has exceeded threshold (1024). It does not tell what was the actual clause count. In lack of this information, how do you optimize the i`ndices.query.bool.max_clause_count` setting? Besides, the documentation says setting a "higher value can lead to performance degradations and memory issues, especially in clusters with a high load or few resources.". I suppose this also depends on the resource dedicated to the cluster. So what is the best way to test & benchmark the performance of cluster to determine at what `max_clause_count` setting value the specific cluster performance is degrading?

Thanks

---

<div class="post-metadata">

**Author:** ![rhar](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rhar](https://discuss.elastic.co/u/rhar)\
**Post date:** [April 14, 2020, 4:49pm UTC](https://discuss.elastic.co/t/span-multi-wildcard-query-determining-max-clause-count-value/227785/2 "2020-04-14T16:49:39Z")

</div>

Can someone please answer or share some pointers? Thanks

---

<div class="post-metadata">

**Author:** ![rhar](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rhar](https://discuss.elastic.co/u/rhar)\
**Post date:** [April 15, 2020, 9:56am UTC](https://discuss.elastic.co/t/span-multi-wildcard-query-determining-max-clause-count-value/227785/3 "2020-04-15T09:56:20Z")

</div>

[@elastic\_team](https://discuss.elastic.co/groups/elastic_team) can I please have your attention? Thanks

---

<div class="post-metadata">

**Author:** ![rhar](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rhar](https://discuss.elastic.co/u/rhar)\
**Post date:** [April 17, 2020, 4:24pm UTC](https://discuss.elastic.co/t/span-multi-wildcard-query-determining-max-clause-count-value/227785/4 "2020-04-17T16:24:42Z")

</div>

[@elastic\_team](https://discuss.elastic.co/groups/elastic_team) trying again!

---

<div class="post-metadata">

**Author:** ![rhar](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rhar](https://discuss.elastic.co/u/rhar)\
**Post date:** [April 21, 2020, 7:53am UTC](https://discuss.elastic.co/t/span-multi-wildcard-query-determining-max-clause-count-value/227785/5 "2020-04-21T07:53:11Z")

</div>

hellooooo!

---

<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:** [May 19, 2020, 8:07am UTC](https://discuss.elastic.co/t/span-multi-wildcard-query-determining-max-clause-count-value/227785/6 "2020-05-19T08:07:54Z")

</div>

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