# A way to reduce mapping fields

**URL:** <https://discuss.elastic.co/t/a-way-to-reduce-mapping-fields/369363>\
**Category:** Elasticsearch\
**Created:** [October 24, 2024, 1:05pm UTC](https://discuss.elastic.co/t/a-way-to-reduce-mapping-fields/369363 "2024-10-24T13:05:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![913043599](https://avatars.discourse-cdn.com/v4/letter/9/e274bd/32.png) [@913043599](https://discuss.elastic.co/u/913043599)\
**Post date:** [October 24, 2024, 1:05pm UTC](https://discuss.elastic.co/t/a-way-to-reduce-mapping-fields/369363/1 "2024-10-24T13:05:08Z")

</div>

Hi all:  
I have discovered a method for reducing the elasticsearch fields. For instance, if there are three keyword fields in an index and they are solely utilized for term queries, then I directly employ a single keyword field and store it in an array format. Could this effectively prevent the field explosion resulting from an excessive number of fields?

---

<div class="post-metadata">

**Author:** ![913043599](https://avatars.discourse-cdn.com/v4/letter/9/e274bd/32.png) [@913043599](https://discuss.elastic.co/u/913043599)\
**Post date:** [October 24, 2024, 1:10pm UTC](https://discuss.elastic.co/t/a-way-to-reduce-mapping-fields/369363/2 "2024-10-24T13:10:46Z")

</div>

And I'm not sure if this would have an impact on the index size and query performance. Could someone help me with that? Thank you.

---

<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:** [October 24, 2024, 1:42pm UTC](https://discuss.elastic.co/t/a-way-to-reduce-mapping-fields/369363/3 "2024-10-24T13:42:18Z")

</div>

That will reduce the number of fields, but at the same time prevent you from searching only one of the fields for a specific value (which you may be OK with). The [flattened field type](https://www.elastic.co/guide/en/elasticsearch/reference/current/flattened.html) does what you describe behind the scenes to find possible matching documents but then automatically checks if it is the correct field that has the value.

---

<div class="post-metadata">

**Author:** ![913043599](https://avatars.discourse-cdn.com/v4/letter/9/e274bd/32.png) [@913043599](https://discuss.elastic.co/u/913043599)\
**Post date:** [October 25, 2024, 2:17am UTC](https://discuss.elastic.co/t/a-way-to-reduce-mapping-fields/369363/4 "2024-10-25T02:17:50Z")

</div>

thanks for your reply。It's really help for me。
