# How to increase message size limit of elasticsearch API (max\_clause\_count)

**URL:** <https://discuss.elastic.co/t/how-to-increase-message-size-limit-of-elasticsearch-api-max-clause-count/181770>\
**Category:** Elasticsearch\
**Created:** [May 20, 2019, 8:35am UTC](https://discuss.elastic.co/t/how-to-increase-message-size-limit-of-elasticsearch-api-max-clause-count/181770 "2019-05-20T08:35:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillaumee](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@Guillaumee](https://discuss.elastic.co/u/Guillaumee)\
**Post date:** [May 20, 2019, 8:35am UTC](https://discuss.elastic.co/t/how-to-increase-message-size-limit-of-elasticsearch-api-max-clause-count/181770/1 "2019-05-20T08:35:41Z")

</div>

Hello elastic world,

I'm currently trying to solve a problem regarding log display in Kibana.  
I'm using elasticsearch 6.6.1 and Kibana 6.6.1.  
When creating vizualization for my log, the data set is missing every long log message (\>~300 char) despite the messages are present in elasticsearch.  
I've tried to use the following configuration change in elasticsearch.yml

```auto
indices.query.bool.max_clause_count: 4096

```

But this doesn't solve my problem. Is there a issue with long message with 6.6.1 ?  
Or do I miss a configuration ?  
Thanks !

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [May 20, 2019, 12:42pm UTC](https://discuss.elastic.co/t/how-to-increase-message-size-limit-of-elasticsearch-api-max-clause-count/181770/2 "2019-05-20T12:42:11Z")

</div>

Hi Guillaumee,

That setting is about the maximum number of terms that can be used in a query so is not appropriate.  
I think the issue is that long messages are actually missing from the index.  
Lucene has a hard limit on the length of indexed values so index mappings tend to set limits for  
keyword fields (see [ignore\_above](https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-above.html) setting)

You end up with too many large unique values in these situations so it would make more sense to do one of the following:

1. Truncate the values (this can be done in the mapping)
2. Pre-process them to recognise certain long messages and swap for shorter reason-codes
3. Hash the values of the text messages (this can be done in the mapping or an ingest pipeline)

---

<div class="post-metadata">

**Author:** ![Guillaumee](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@Guillaumee](https://discuss.elastic.co/u/Guillaumee)\
**Post date:** [May 20, 2019, 6:39pm UTC](https://discuss.elastic.co/t/how-to-increase-message-size-limit-of-elasticsearch-api-max-clause-count/181770/3 "2019-05-20T18:39:13Z")

</div>

Thanks Mark I solved the problem by updating the mapping of the index 🙂

---

<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:** [June 17, 2019, 6:39pm UTC](https://discuss.elastic.co/t/how-to-increase-message-size-limit-of-elasticsearch-api-max-clause-count/181770/4 "2019-06-17T18:39:19Z")

</div>

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