# Raise Elasticsearch field limit via config

**URL:** https://discuss.elastic.co/t/raise-elasticsearch-field-limit-via-config/365602
**Category:** Elasticsearch
**Created:** [August 27, 2024, 7:51am UTC](https://discuss.elastic.co/t/raise-elasticsearch-field-limit-via-config/365602 "2024-08-27T07:51:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![daniel90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel90/32/77633_2.png) [@daniel90](https://discuss.elastic.co/u/daniel90)
#### Post date: [August 27, 2024, 7:51am UTC](https://discuss.elastic.co/t/raise-elasticsearch-field-limit-via-config/365602/1 "2024-08-27T07:51:16Z")

</div>

I tried the obvious, but that gives me the:  
"node settings must not contain any index level settings"

Error

So how do i do it?

I want a permanent solution that does not involve a cronjob setting the limit to X every 6 hours to account for potential restarts.

Now that I think about it that is not THAT bad. But just putting it in the config would be way cleaner.

---

<div class="post-metadata">

### Author: ![Musab\_Dogan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/musab_dogan/32/70691_2.png) [@Musab\_Dogan](https://discuss.elastic.co/u/Musab_Dogan)
#### Post date: [August 27, 2024, 8:10am UTC](https://discuss.elastic.co/t/raise-elasticsearch-field-limit-via-config/365602/2 "2024-08-27T08:10:26Z")

</div>

You can use index template to automate this process. Beats and other elasticsearch components using that way.

```auto
PUT _index_template/index-template-for-field-limit
{
  "template": {
    "settings": {
      "index.mapping.total_fields.limit": "10000"
    }
  },
  "index_patterns": [
    "index-name-*"
  ]
}

```

References:

> **[Mapping limit settings | Elasticsearch Guide \[8.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-settings-limit.html)**

> **[Index templates | Elasticsearch Guide \[8.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html)**

---

<div class="post-metadata">

### Author: ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)
#### Post date: [August 27, 2024, 8:13am UTC](https://discuss.elastic.co/t/raise-elasticsearch-field-limit-via-config/365602/3 "2024-08-27T08:13:38Z")

</div>

Hello Daniel,

I recommend to use [Index Templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html) for this. It allows to set this setting for all indices that match the index template pattern.  
You could even go so far to extract the setting to a component template and reuse it in multiple Index Templates.

I would advise to be cautious with this setting and only enabling it where absolutely necessary as this limit is there for a [reason](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-settings-limit.html):

> The limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance degradations and memory issues, especially in clusters with a high load or few resources.
> 
> If you increase this setting, we recommend you also increase the [`indices.query.bool.max_clause_count`](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-settings.html) setting, which limits the maximum number of clauses in a query.

Best regards  
Wolfram

---

<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: [September 24, 2024, 8:14am UTC](https://discuss.elastic.co/t/raise-elasticsearch-field-limit-via-config/365602/4 "2024-09-24T08:14:07Z")

</div>

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