# When 'index' attribute in fields are shown when retrieving mapping?

**URL:** <https://discuss.elastic.co/t/when-index-attribute-in-fields-are-shown-when-retrieving-mapping/25089>\
**Category:** Elasticsearch\
**Created:** [July 7, 2015, 9:19pm UTC](https://discuss.elastic.co/t/when-index-attribute-in-fields-are-shown-when-retrieving-mapping/25089 "2015-07-07T21:19:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leandroico](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@leandroico](https://discuss.elastic.co/u/leandroico)\
**Post date:** [July 7, 2015, 9:19pm UTC](https://discuss.elastic.co/t/when-index-attribute-in-fields-are-shown-when-retrieving-mapping/25089/1 "2015-07-07T21:19:25Z")

</div>

I noticed that even if I set { "index": "not\_analyzed" } for certain types of fields, like for instance integer, it apparently ignores, because when I fetch the mapping for the given index/type, such attribute doesn't come together with the given field.

That is obvious, given analyzing integer fields doesn't make sense at all.  
So my question is: should I consider only "string" fields to bring such "index" attribute when retrieving mappings from the server? So, considering the existing core types, should I consider the types integer/long, float/double and boolean as types where the "index" attribute doesn't apply to?

---

<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:** [July 8, 2015, 1:26am UTC](https://discuss.elastic.co/t/when-index-attribute-in-fields-are-shown-when-retrieving-mapping/25089/2 "2015-07-08T01:26:42Z")

</div>

This should be applied, it might help if we can see your overall mapping.

---

<div class="post-metadata">

**Author:** ![leandroico](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@leandroico](https://discuss.elastic.co/u/leandroico)\
**Post date:** [July 8, 2015, 4:54pm UTC](https://discuss.elastic.co/t/when-index-attribute-in-fields-are-shown-when-retrieving-mapping/25089/3 "2015-07-08T16:54:38Z")

</div>

But it turns out it doesn't apply. If the field is of type integer, for instance, and the index attribute is not\_analyzed it doesn't even get registered in the mapping. At least if I retrieve the type mapping the index attribute doesn't come along within the field.

---

<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 6, 2017, 12:02am UTC](https://discuss.elastic.co/t/when-index-attribute-in-fields-are-shown-when-retrieving-mapping/25089/4 "2017-07-06T00:02:50Z")

</div>


