# Can multi-fields be used to overcome index.mapping.total\_fields.limit?

**URL:** <https://discuss.elastic.co/t/can-multi-fields-be-used-to-overcome-index-mapping-total-fields-limit/130454>\
**Category:** Elasticsearch\
**Created:** [May 3, 2018, 1:11pm UTC](https://discuss.elastic.co/t/can-multi-fields-be-used-to-overcome-index-mapping-total-fields-limit/130454 "2018-05-03T13:11:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cristi\_Cioriia](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@Cristi\_Cioriia](https://discuss.elastic.co/u/Cristi_Cioriia)\
**Post date:** [May 3, 2018, 1:11pm UTC](https://discuss.elastic.co/t/can-multi-fields-be-used-to-overcome-index-mapping-total-fields-limit/130454/1 "2018-05-03T13:11:13Z")

</div>

Hi,

We're storing into ES documents that contain an event field that is a JSON object that can have a free-form structure, e.g. a document might have a JSON object which contains a name field, while another json might contain an "age" field. In time, the number of fields in the event field might be bigger than index.mapping.total\_fields.limit . In order to overcome this problem we thought that we could store the event as string and map it as a multi-field:

```
"event": {
      "type": "text",
      "fields": {
        "raw": { 
          "type": "keyword"
        }
      }

```

Would this help us get rid of the limitation imposed by the index.mapping.total\_fields.limit or the problem would continue to appear due to the event.raw field?

Thanks,  
Cristi

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [May 3, 2018, 3:54pm UTC](https://discuss.elastic.co/t/can-multi-fields-be-used-to-overcome-index-mapping-total-fields-limit/130454/2 "2018-05-03T15:54:15Z")

</div>

Multi-fields are just syntactic sugar for prefixing regular fields. E.g. that mapping is effectively equivalent to this mapping internally:

```auto
"event": {
  "type": "text"
},
"event.raw": {
  "type": "keyword"
}

```

E.g. the fields syntax basically creates another field internally, which Elasticsearch knows how to use with the various fields syntax.

So it won't let you bypass the `total_fields.limit` setting.

---

<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 31, 2018, 3:54pm UTC](https://discuss.elastic.co/t/can-multi-fields-be-used-to-overcome-index-mapping-total-fields-limit/130454/3 "2018-05-31T15:54:22Z")

</div>

Closed on May 31, 2018, 3:54pm UTC

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