# Too\_many\_clauses: maxClauseCount is set to 1337

**URL:** <https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1337/339894>\
**Category:** Elasticsearch\
**Created:** [August 2, 2023, 7:29am UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1337/339894 "2023-08-02T07:29:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![drorp\_korra](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@drorp\_korra](https://discuss.elastic.co/u/drorp_korra)\
**Post date:** [August 2, 2023, 7:29am UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1337/339894/1 "2023-08-02T07:29:16Z")

</div>

Hello,

i'm getting the this error:

```auto
ApiError(500, 'search_phase_execution_exception', 'too_many_clauses: maxClauseCount is set to 1337')

```

The query that is use is:

```auto
{
	"bool": {
		"filter": [
			{
				"term": {
					"filter1": value1
				}
			},
			{
				"term": {
					"filter2": value2
				}
			}
		],
		"should": [
			{
				"match": {
					"text": {
						"fuzziness": 2,
						"query": my_query 
					}
				}
			}
		]
	}
}

```

my\_query is ~100 words, and the index that is searched has ~80k documents.  
The Elastic version is 8.4.1

Any advice on what to do in this scenario?

Thanks in advance

---

<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:** [August 30, 2023, 7:29am UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1337/339894/2 "2023-08-30T07:29:58Z")

</div>

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