# Does ES load field data when specifying fields in a query?

**URL:** <https://discuss.elastic.co/t/does-es-load-field-data-when-specifying-fields-in-a-query/1769>\
**Category:** Elasticsearch\
**Created:** [June 2, 2015, 7:18pm UTC](https://discuss.elastic.co/t/does-es-load-field-data-when-specifying-fields-in-a-query/1769 "2015-06-02T19:18:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![javadevmtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javadevmtl/32/45613_2.png) [@javadevmtl](https://discuss.elastic.co/u/javadevmtl)\
**Post date:** [June 2, 2015, 7:18pm UTC](https://discuss.elastic.co/t/does-es-load-field-data-when-specifying-fields-in-a-query/1769/1 "2015-06-02T19:18:35Z")

</div>

Just as the title asks...

I'm using doc\_values where ever possible. But I have a query that specifies specific fields to return rather then the full source.

Are those fields loaded in fieldata cache?

---

<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 2, 2015, 11:19pm UTC](https://discuss.elastic.co/t/does-es-load-field-data-when-specifying-fields-in-a-query/1769/2 "2015-06-02T23:19:04Z")

</div>

It will, so that it can do the query on them. But as fas as I understand it won't load into fielddata cache, it'll just load them to read them and then eventually age out with GC.

---

<div class="post-metadata">

**Author:** ![javadevmtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javadevmtl/32/45613_2.png) [@javadevmtl](https://discuss.elastic.co/u/javadevmtl)\
**Post date:** [June 2, 2015, 11:57pm UTC](https://discuss.elastic.co/t/does-es-load-field-data-when-specifying-fields-in-a-query/1769/3 "2015-06-02T23:57:27Z")

</div>

Ok let me check closer, cause I switched to doc\_values and I got field\_data cache growing. I may have missed a field or it may be a non doc\_value field

---

<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 3, 2015, 12:29am UTC](https://discuss.elastic.co/t/does-es-load-field-data-when-specifying-fields-in-a-query/1769/4 "2015-06-03T00:29:41Z")

</div>

Unless you have _everything_ as docvalues, wjhich can only be done on unanalysed fields, you will still get fielddata cache growth.

---

<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:10am UTC](https://discuss.elastic.co/t/does-es-load-field-data-when-specifying-fields-in-a-query/1769/5 "2017-07-06T00:10:04Z")

</div>

Closed on July 6, 2017, 12:10am UTC


