# When are the DOC\_VALUES used by elastic?

**URL:** <https://discuss.elastic.co/t/when-are-the-doc-values-used-by-elastic/72003>\
**Category:** Elasticsearch\
**Created:** [January 18, 2017, 12:35pm UTC](https://discuss.elastic.co/t/when-are-the-doc-values-used-by-elastic/72003 "2017-01-18T12:35:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasia](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@kasia](https://discuss.elastic.co/u/kasia)\
**Post date:** [January 18, 2017, 12:35pm UTC](https://discuss.elastic.co/t/when-are-the-doc-values-used-by-elastic/72003/1 "2017-01-18T12:35:39Z")

</div>

Hi,  
In the documentation and in some of the posts, you recommend using multi-fields to have a particular field available for both full text search and aggregations / sorting.  
Something like this:

```
"properties": {
  "title": {
    "type": "text",
    "analyzer": "my_analyzer",
    "fields": {
      "raw": {
        "type": "keyword",
        "index": false
      }
    }
  }
}

```

Doc\_values are available by default for data types \<\> text.  
Does it mean that every sorting or aggregation on title.raw will always use doc\_values access pattern to perform a required operation?

In which case using multi-fields with the doc\_values disabled could be useful?

kind regards,  
Kasia

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [January 18, 2017, 1:34pm UTC](https://discuss.elastic.co/t/when-are-the-doc-values-used-by-elastic/72003/2 "2017-01-18T13:34:24Z")

</div>

From [https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html:](https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html:)

" If you are sure that you don’t need to sort or aggregate on a field, or access the field value from a script, you can disable doc values in order to save disk space"

Hope this helps,  
Isabel

---

<div class="post-metadata">

**Author:** ![kasia](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@kasia](https://discuss.elastic.co/u/kasia)\
**Post date:** [January 18, 2017, 1:52pm UTC](https://discuss.elastic.co/t/when-are-the-doc-values-used-by-elastic/72003/3 "2017-01-18T13:52:09Z")

</div>

It helped:slight\_smile: Thank you, Isabel.  
As for the second question, I already know the answer. For instance, multi-fields to use 2 different analyzers for a multi-match query in order to increase recall could be a case.

best regards,  
Kasia

---

<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:** [February 15, 2017, 1:52pm UTC](https://discuss.elastic.co/t/when-are-the-doc-values-used-by-elastic/72003/4 "2017-02-15T13:52:16Z")

</div>

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