# Mapping explosion, how to refactor?

**URL:** <https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473>\
**Category:** Elasticsearch\
**Created:** [September 4, 2020, 3:14am UTC](https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473 "2020-09-04T03:14:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DumpCat](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@DumpCat](https://discuss.elastic.co/u/DumpCat)\
**Post date:** [September 4, 2020, 3:14am UTC](https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473/1 "2020-09-04T03:14:59Z")

</div>

We have hbase with thousands of colume and sync colume data to elasticsearch periodically, but it is causing mapping explosion. Every field in elasticsearch maybe be searched by user, how do I to refactor? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 4, 2020, 3:21am UTC](https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473/2 "2020-09-04T03:21:20Z")

</div>

Does every document have every field, or have you put different documents into the same index?

---

<div class="post-metadata">

**Author:** ![DumpCat](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@DumpCat](https://discuss.elastic.co/u/DumpCat)\
**Post date:** [September 7, 2020, 3:53am UTC](https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473/3 "2020-09-07T03:53:23Z")

</div>

Yes, every document have every field. Almost all fields need to be searched. It is all relevant.

---

<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:** [September 7, 2020, 5:21am UTC](https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473/4 "2020-09-07T05:21:46Z")

</div>

Is it resulting in very large mappings or are your mappings actually exploding due to e.g. dynamically created field names, e.g. dates or numbers?

---

<div class="post-metadata">

**Author:** ![DumpCat](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@DumpCat](https://discuss.elastic.co/u/DumpCat)\
**Post date:** [September 9, 2020, 2:33am UTC](https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473/5 "2020-09-09T02:33:43Z")

</div>

We use dynamically created field names. Is it possible to use array to solve it?

---

<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:** [September 9, 2020, 4:27am UTC](https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473/6 "2020-09-09T04:27:55Z")

</div>

I do not know what your data looks like so can not tell. Having dynamically generated field names is generally a bad practice though.

---

<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:** [October 7, 2020, 4:27am UTC](https://discuss.elastic.co/t/mapping-explosion-how-to-refactor/247473/7 "2020-10-07T04:27:57Z")

</div>

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