# How to properly specify doc\_values?

**URL:** https://discuss.elastic.co/t/how-to-properly-specify-doc-values/24852
**Category:** Elasticsearch
**Created:** [July 3, 2015, 9:31am UTC](https://discuss.elastic.co/t/how-to-properly-specify-doc-values/24852 "2015-07-03T09:31:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pe\_Ter](https://avatars.discourse-cdn.com/v4/letter/p/49beb7/32.png) [@Pe\_Ter](https://discuss.elastic.co/u/Pe_Ter)
#### Post date: [July 3, 2015, 9:31am UTC](https://discuss.elastic.co/t/how-to-properly-specify-doc-values/24852/1 "2015-07-03T09:31:19Z")

</div>

Seems there's two alternate ways to specify that a field should use docvalues:

```
"doc_values": True

```

and

```
"fielddata": {"format": "doc_values"}

```

What's the difference?

---

<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 4, 2015, 3:39am UTC](https://discuss.elastic.co/t/how-to-properly-specify-doc-values/24852/2 "2015-07-04T03:39:03Z")

</div>

[The docs](https://www.elastic.co/guide/en/elasticsearch/guide/current/doc-values.html#_enabling_doc_values) suggest the first one.

Are you getting the second one from [this](https://www.elastic.co/blog/disk-based-field-data-a-k-a-doc-values) blog post?

---

<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:03am UTC](https://discuss.elastic.co/t/how-to-properly-specify-doc-values/24852/3 "2017-07-06T00:03:36Z")

</div>


