# Confusion about index and doc\_values

**URL:** <https://discuss.elastic.co/t/confusion-about-index-and-doc-values/210448>\
**Category:** Elasticsearch\
**Created:** [December 4, 2019, 3:09am UTC](https://discuss.elastic.co/t/confusion-about-index-and-doc-values/210448 "2019-12-04T03:09:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KellyK313](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@KellyK313](https://discuss.elastic.co/u/KellyK313)\
**Post date:** [December 4, 2019, 3:09am UTC](https://discuss.elastic.co/t/confusion-about-index-and-doc-values/210448/1 "2019-12-04T03:09:16Z")

</div>

When I test the mapping parameter 'index' and 'doc\_values',I found out that when numeric type "index" set "false" and this column can not be aggregated,the result will be 0.  
In my opinion,I think 'index' controls the query and 'doc\_values' controls the aggregation,but above result really confuse me.

---

<div class="post-metadata">

**Author:** ![nishant.saini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nishant.saini/32/41489_2.png) [@nishant.saini](https://discuss.elastic.co/u/nishant.saini)\
**Post date:** [December 5, 2019, 3:12am UTC](https://discuss.elastic.co/t/confusion-about-index-and-doc-values/210448/2 "2019-12-05T03:12:36Z")

</div>

What you understood is correct; `index` controls query and `doc_values`controls the aggregation. This is not different for string type of field and numeric type of field. It behaves the same for both. Can you add the mapping and query that you tried which resulted in the confusion.

---

<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:** [January 3, 2020, 3:39am UTC](https://discuss.elastic.co/t/confusion-about-index-and-doc-values/210448/4 "2020-01-03T03:39:26Z")

</div>

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