# Is there are max number of operators in a query?

**URL:** <https://discuss.elastic.co/t/is-there-are-max-number-of-operators-in-a-query/275291>\
**Category:** Elasticsearch\
**Created:** [June 8, 2021, 11:35am UTC](https://discuss.elastic.co/t/is-there-are-max-number-of-operators-in-a-query/275291 "2021-06-08T11:35:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandra\_Schlichting](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandra_schlichting/32/84122_2.png) [@Sandra\_Schlichting](https://discuss.elastic.co/u/Sandra_Schlichting)\
**Post date:** [June 8, 2021, 11:35am UTC](https://discuss.elastic.co/t/is-there-are-max-number-of-operators-in-a-query/275291/1 "2021-06-08T11:35:34Z")

</div>

Dear all =)

Ideally would I like to make a search query that contains approx 100 `OR` operators and 1 `AND NOT` like so

```auto
(logLevel:error OR logLevel:fatal) AND NOT
(searchString1 OR searchString2 OR searchString3 OR ... OR searchString100)

```

where a `searchString` would typically be simple such as `msg:'Could not find ID'` but with approx 100 different messages.

I want to find all the errors I don't know how to search for. All the `searchString`'s are error messages I know about, so the purpose of this is to create a "Catch All" =)

Which raises the following questions =)

1. Is there a max number of operators in a query? 500 would be excellent if possible =)
2. Will this be CPU heavy on Elastic?
3. Are there a better way to do it?

Hugs,  
Sandra =)

---

<div class="post-metadata">

**Author:** ![Sandra\_Schlichting](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandra_schlichting/32/84122_2.png) [@Sandra\_Schlichting](https://discuss.elastic.co/u/Sandra_Schlichting)\
**Post date:** [June 9, 2021, 12:27pm UTC](https://discuss.elastic.co/t/is-there-are-max-number-of-operators-in-a-query/275291/2 "2021-06-09T12:27:53Z")

</div>

I have found a better way to do it. Each document have the unique `_id` which I can use to delete duplicates.

---

<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 7, 2021, 12:28pm UTC](https://discuss.elastic.co/t/is-there-are-max-number-of-operators-in-a-query/275291/3 "2021-07-07T12:28:50Z")

</div>

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