# Terms Lookup on Ip fields and the too\_many\_clauses: maxClauseCount issue

**URL:** <https://discuss.elastic.co/t/terms-lookup-on-ip-fields-and-the-too-many-clauses-maxclausecount-issue/270130>\
**Category:** Elasticsearch\
**Created:** [April 14, 2021, 4:17pm UTC](https://discuss.elastic.co/t/terms-lookup-on-ip-fields-and-the-too-many-clauses-maxclausecount-issue/270130 "2021-04-14T16:17:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_Bismondo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/giovanni_bismondo/32/86921_2.png) [@Giovanni\_Bismondo](https://discuss.elastic.co/u/Giovanni_Bismondo)\
**Post date:** [April 14, 2021, 4:17pm UTC](https://discuss.elastic.co/t/terms-lookup-on-ip-fields-and-the-too-many-clauses-maxclausecount-issue/270130/1 "2021-04-14T16:17:31Z")

</div>

Hi,  
I'm trying to make a query with Terms Lookup to filter an index by ip addresses included in an array (of another document in another index).  
I get the too\_many\_clauses: maxClauseCount issue, but I found in questions from other users that it can be avoided using the conditional token 'filter' (I don't need any ranking), but in my case I still get the error.

I found this issue (from 2017) that is EXACTLY my case:

[https://github.com/elastic/elasticsearch/issues/25667](https://github.com/elastic/elasticsearch/issues/25667)

I can't understand if the issue was fixed and closed (and there is a regression) or just closed.

I'm using the version 7.10.2

Thank you 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:** [May 12, 2021, 4:17pm UTC](https://discuss.elastic.co/t/terms-lookup-on-ip-fields-and-the-too-many-clauses-maxclausecount-issue/270130/2 "2021-05-12T16:17:39Z")

</div>

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