# Elastic Search Inverted Indexes + Dynamic mappings

**URL:** <https://discuss.elastic.co/t/elastic-search-inverted-indexes-dynamic-mappings/218580>\
**Category:** Elasticsearch\
**Created:** [February 10, 2020, 12:04pm UTC](https://discuss.elastic.co/t/elastic-search-inverted-indexes-dynamic-mappings/218580 "2020-02-10T12:04:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andresribeiro1996](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@andresribeiro1996](https://discuss.elastic.co/u/andresribeiro1996)\
**Post date:** [February 10, 2020, 12:04pm UTC](https://discuss.elastic.co/t/elastic-search-inverted-indexes-dynamic-mappings/218580/1 "2020-02-10T12:04:33Z")

</div>

Hey, i have some doubts about elastic performance in this scenario:

So we have index Contacts, and we want to insert docs that have dynamic searchable data into this index, e.g:

contactA has 3 fields, name, age, address.

contactB has 4 fields, name, age, address, title.

contactC has 5 fields, name, age, title, country, phone.

We know its possible to make all those fields searchable due to dynamic mappings. but the thing that bothers us is that this index aims to store a lot of data and there can be contacts with +20 fields, so the question is related to how elastic works underground with the inverted keys, if we have a lot of dynamic fields we fear that elastic may become very slow reindex, is this true? Im recent to elastic so i may be saying some stupidity 😛  
Anyway if u also think this can be a problem should we limit the number of dynamic fields on our side then?

---

<div class="post-metadata">

**Author:** ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)\
**Post date:** [February 10, 2020, 2:16pm UTC](https://discuss.elastic.co/t/elastic-search-inverted-indexes-dynamic-mappings/218580/2 "2020-02-10T14:16:21Z")

</div>

It indeed effects the performance of elasticsearch if you have too many fields. But i don't think 20+ fields will be a problem. Elasticsearch by default set's a limit of 1000 fields per index (which is configurable).

Having said that, custom mapping, when possible, is better than dynamic mapping. It gives more control over your data.

---

<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:** [March 9, 2020, 2:27pm UTC](https://discuss.elastic.co/t/elastic-search-inverted-indexes-dynamic-mappings/218580/3 "2020-03-09T14:27:43Z")

</div>

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