# Mapping recommendations

**URL:** <https://discuss.elastic.co/t/mapping-recommendations/238619>\
**Category:** Elasticsearch\
**Created:** [June 25, 2020, 8:17am UTC](https://discuss.elastic.co/t/mapping-recommendations/238619 "2020-06-25T08:17:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![111302](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111302/32/71093_2.png) [@111302](https://discuss.elastic.co/u/111302)\
**Post date:** [June 25, 2020, 8:17am UTC](https://discuss.elastic.co/t/mapping-recommendations/238619/1 "2020-06-25T08:17:26Z")

</div>

Hi, I have several question regarding ES mapping.

1. Should all the fields of the document be included in the mapping? or only those that i will search on?
2. Are fields without mapping even searchable? if they are, how much slower to search on those field compared to mapped ones?

Thanks

---

<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:** [June 25, 2020, 8:18am UTC](https://discuss.elastic.co/t/mapping-recommendations/238619/2 "2020-06-25T08:18:59Z")

</div>

If you use dynamic mapping they will default to being searchable.

If you don't want that, use static mapping.

---

<div class="post-metadata">

**Author:** ![111302](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111302/32/71093_2.png) [@111302](https://discuss.elastic.co/u/111302)\
**Post date:** [June 25, 2020, 8:31am UTC](https://discuss.elastic.co/t/mapping-recommendations/238619/3 "2020-06-25T08:31:45Z")

</div>

Thanks for your reply

So, correct me if i'm wrong, but the whole purpose of the mapping is to make the field searchable.  
If i have fields that i don't to search on (only to retrieve them with the query) then there's no reason to create mapping for them, is that correct?

---

<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:** [June 25, 2020, 8:35am UTC](https://discuss.elastic.co/t/mapping-recommendations/238619/4 "2020-06-25T08:35:09Z")

</div>

A field _has_ to be mapped. In that mapping you can define it to be searchable or not.

If you don't explicitly map a field, and you don't have strict mapping set, then it will have a dynamic mapping applied to it which will make it searchable.

So either way it will be mapped.

---

<div class="post-metadata">

**Author:** ![111302](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111302/32/71093_2.png) [@111302](https://discuss.elastic.co/u/111302)\
**Post date:** [June 25, 2020, 8:53am UTC](https://discuss.elastic.co/t/mapping-recommendations/238619/5 "2020-06-25T08:53:23Z")

</div>

OK, I get it now  
Thank you!

---

<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:** [July 23, 2020, 8:53am UTC](https://discuss.elastic.co/t/mapping-recommendations/238619/6 "2020-07-23T08:53:30Z")

</div>

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