# The confusion of elasticsearch?

**URL:** https://discuss.elastic.co/t/the-confusion-of-elasticsearch/65898
**Category:** Elasticsearch
**Created:** [November 13, 2016, 8:01am UTC](https://discuss.elastic.co/t/the-confusion-of-elasticsearch/65898 "2016-11-13T08:01:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![famoss](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@famoss](https://discuss.elastic.co/u/famoss)
#### Post date: [November 13, 2016, 8:01am UTC](https://discuss.elastic.co/t/the-confusion-of-elasticsearch/65898/1 "2016-11-13T08:01:11Z")

</div>

After read the document of the `es`,There are some confusion about it.

`doc_values` built at a document index time on not `text` field,save data in disk.

`fielddata` built at query time,save data in memory.If a field cached,when the new docs has the field add to the `fielddata` cache?

`doc_values` and `fielddata` are both a `cache`,are used mainly when sorting on or computing aggregations on a field?

`query cache`,Only save the query result,only the same `dsl` can use it?

`Es` has any other cache?

---

<div class="post-metadata">

### Author: ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)
#### Post date: [November 14, 2016, 1:18pm UTC](https://discuss.elastic.co/t/the-confusion-of-elasticsearch/65898/2 "2016-11-14T13:18:36Z")

</div>

Hi @famoss,

> [@famoss](#):
>
> doc\_values and fielddata are both a cache

you cannot exactly say that "doc values" are a cache. Doc values are a data structure that is optimized for an access pattern "document" -\> "list of terms" which is needed for e.g. sorting and aggregations. The implementation of doc values relies on the operating systems "page cache" which maps pages from disk to memory as needed. Also field data is a data structure.

> [@famoss](#):
>
> Es has any other cache?

We have:

- [Field data cache](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-fielddata.html)
- [Node query cache](https://www.elastic.co/guide/en/elasticsearch/reference/master/query-cache.html)
- [Shard request cache](https://www.elastic.co/guide/en/elasticsearch/reference/master/shard-request-cache.html)

You can also check the [Definitive Guide](https://www.elastic.co/guide/en/elasticsearch/guide/master/index.html) which explains a lot of concepts in great detail.

Daniel

---

<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: [December 12, 2016, 1:19pm UTC](https://discuss.elastic.co/t/the-confusion-of-elasticsearch/65898/3 "2016-12-12T13:19:07Z")

</div>

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