# Multi field mapping and mapping explosion

**URL:** <https://discuss.elastic.co/t/multi-field-mapping-and-mapping-explosion/225005>\
**Category:** Elasticsearch\
**Created:** [March 25, 2020, 2:40pm UTC](https://discuss.elastic.co/t/multi-field-mapping-and-mapping-explosion/225005 "2020-03-25T14:40:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dao](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dao](https://discuss.elastic.co/u/dao)\
**Post date:** [March 25, 2020, 2:40pm UTC](https://discuss.elastic.co/t/multi-field-mapping-and-mapping-explosion/225005/1 "2020-03-25T14:40:48Z")

</div>

By default, it seems that all my strings are dynamically mapped to a multifield like below. I am concerned with [mapping explosion](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html#mapping-limit-settings)

Does those multi fields are counted as 2 fields? here below, `REG` and `REG.keyword` are considered as 1 field, or 2 fields?

If it is 2 fields, how can I change the dynamic mapping to map json strings into only keywords?

```auto
        "REG" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        }

```

---

<div class="post-metadata">

**Author:** ![dao](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dao](https://discuss.elastic.co/u/dao)\
**Post date:** [March 26, 2020, 3:59pm UTC](https://discuss.elastic.co/t/multi-field-mapping-and-mapping-explosion/225005/2 "2020-03-26T15:59:01Z")

</div>

Additionally, what happens if I reach the 1000 fields threashold?  
If I want to insert a document (logstash), what will happend with the doc?

are the existing fields indexed and the new ones ignored, or the whole document is rejected?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 29, 2020, 2:06pm UTC](https://discuss.elastic.co/t/multi-field-mapping-and-mapping-explosion/225005/3 "2020-03-29T14:06:03Z")

</div>

> [@dao](#):
>
> If it is 2 fields, how can I change the dynamic mapping to map json strings into only keywords?

That should count as 2 fields as far as I know. You can control this by creating an index template with the dynamic mappings you need.

> [@dao](#):
>
> Additionally, what happens if I reach the 1000 fields threashold?  
> If I want to insert a document (logstash), what will happend with the doc?

The whole document would be rejected.

---

<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:** [April 26, 2020, 2:06pm UTC](https://discuss.elastic.co/t/multi-field-mapping-and-mapping-explosion/225005/4 "2020-04-26T14:06:12Z")

</div>

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