# Safe to set doc\_values: true on existing index?

**URL:** https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502
**Category:** Elasticsearch
**Created:** [March 3, 2015, 11:17pm UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502 "2015-03-03T23:17:13Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Justin\_Zhu\_2](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@Justin\_Zhu\_2](https://discuss.elastic.co/u/Justin_Zhu_2)
#### Post date: [March 3, 2015, 11:17pm UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/1 "2015-03-03T23:17:13Z")

</div>

Would this start building the doc values structure for new documents  
indexed and not prior docs?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [March 3, 2015, 11:54pm UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/2 "2015-03-03T23:54:57Z")

</div>

Yes, it will do exactly that.

On 4 March 2015 at 10:17, Justin Zhu [haoranjzhu@gmail.com](mailto:haoranjzhu@gmail.com) wrote:

> Would this start building the doc values structure for new documents  
> indexed and not prior docs?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9mTNHoOX5wyaqP5iwJ\_S0abtQHosCzQXbTryzBk-tmJg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9mTNHoOX5wyaqP5iwJ_S0abtQHosCzQXbTryzBk-tmJg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Justin\_Zhu\_2](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@Justin\_Zhu\_2](https://discuss.elastic.co/u/Justin_Zhu_2)
#### Post date: [March 4, 2015, 3:00am UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/3 "2015-03-04T03:00:17Z")

</div>

Excellent. Noticed Boolean is unsupported right now, can we add the  
doc\_values: true anyways for future use?:

On Tuesday, March 3, 2015 at 3:55:30 PM UTC-8, Mark Walkom wrote:

> Yes, it will do exactly that.
> 
> On 4 March 2015 at 10:17, Justin Zhu \<[haora...@gmail.com](mailto:haora...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Would this start building the doc values structure for new documents  
> > indexed and not prior docs?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c492600a-eb4a-4ad2-8893-a079f79eab1d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c492600a-eb4a-4ad2-8893-a079f79eab1d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Dennis](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Dennis](https://discuss.elastic.co/u/Dennis)
#### Post date: [March 4, 2015, 5:13am UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/4 "2015-03-04T05:13:50Z")

</div>

I read the manual, and I still don't quite get what doc\_values is. Anyone  
can explain it better than the manual?

On Tuesday, March 3, 2015 at 3:17:13 PM UTC-8, Justin Zhu wrote:

> Would this start building the doc values structure for new documents  
> indexed and not prior docs?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c5ed7e7b-e4a6-49fc-9060-fd2837f3b93c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c5ed7e7b-e4a6-49fc-9060-fd2837f3b93c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [March 4, 2015, 6:16am UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/5 "2015-03-04T06:16:05Z")

</div>

It replaces field data and instead of storing things in heap, it stores  
them on disk. You take a minor performance hit but you get a lot more back  
by freeing up your heap.

On 4 March 2015 at 16:13, Dennis [gearond@gmail.com](mailto:gearond@gmail.com) wrote:

> I read the manual, and I still don't quite get what doc\_values is. Anyone  
> can explain it better than the manual?
> 
> On Tuesday, March 3, 2015 at 3:17:13 PM UTC-8, Justin Zhu wrote:
> 
> > Would this start building the doc values structure for new documents  
> > indexed and not prior docs?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/c5ed7e7b-e4a6-49fc-9060-fd2837f3b93c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c5ed7e7b-e4a6-49fc-9060-fd2837f3b93c%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/c5ed7e7b-e4a6-49fc-9060-fd2837f3b93c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c5ed7e7b-e4a6-49fc-9060-fd2837f3b93c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-kx7J2uG%2BmmbQ0jv2vrMRLyYQY109wXyK2dU%2BAVMRdiQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-kx7J2uG%2BmmbQ0jv2vrMRLyYQY109wXyK2dU%2BAVMRdiQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [March 4, 2015, 10:04am UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/6 "2015-03-04T10:04:05Z")

</div>

Unfortunately, doc values cannot be added on an existing index. However it  
would work if you have eg. daily indices and change your index template so  
that new indices have doc values enabled.

On the other hand, if you want to add doc values to an existing index, you  
would need to reindex.

On Wed, Mar 4, 2015 at 12:17 AM, Justin Zhu [haoranjzhu@gmail.com](mailto:haoranjzhu@gmail.com) wrote:

> Would this start building the doc values structure for new documents  
> indexed and not prior docs?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF\_Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF_Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [March 4, 2015, 10:43am UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/7 "2015-03-04T10:43:00Z")

</div>

After chatting with Adrien about this and how the code works, I'll defer to  
his greater knowledge.  
On 04/03/2015 9:04 pm, "Adrien Grand" [adrien.grand@elasticsearch.com](mailto:adrien.grand@elasticsearch.com)  
wrote:

> Unfortunately, doc values cannot be added on an existing index. However it  
> would work if you have eg. daily indices and change your index template so  
> that new indices have doc values enabled.
> 
> On the other hand, if you want to add doc values to an existing index, you  
> would need to reindex.
> 
> On Wed, Mar 4, 2015 at 12:17 AM, Justin Zhu [haoranjzhu@gmail.com](mailto:haoranjzhu@gmail.com) wrote:
> 
> > Would this start building the doc values structure for new documents  
> > indexed and not prior docs?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Adrien Grand
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF\_Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF_Q%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF\_Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF_Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X\_Ga%3Dh8cKS%2BbBztcG8N5QveK0%3DqM4e49LFPjZQXk79Phg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X_Ga%3Dh8cKS%2BbBztcG8N5QveK0%3DqM4e49LFPjZQXk79Phg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Justin\_Zhu\_2](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@Justin\_Zhu\_2](https://discuss.elastic.co/u/Justin_Zhu_2)
#### Post date: [March 6, 2015, 2:09am UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/8 "2015-03-06T02:09:25Z")

</div>

Thanks for the info Adrien & Mark. Looks like we'll just reindex.

On Wednesday, March 4, 2015 at 2:43:15 AM UTC-8, Mark Walkom wrote:

> After chatting with Adrien about this and how the code works, I'll defer  
> to his greater knowledge.  
> On 04/03/2015 9:04 pm, "Adrien Grand" \<[adrien...@elasticsearch.com](mailto:adrien...@elasticsearch.com)  
> \<javascript:\>\> wrote:
> 
> > Unfortunately, doc values cannot be added on an existing index. However  
> > it would work if you have eg. daily indices and change your index template  
> > so that new indices have doc values enabled.
> > 
> > On the other hand, if you want to add doc values to an existing index,  
> > you would need to reindex.
> > 
> > On Wed, Mar 4, 2015 at 12:17 AM, Justin Zhu \<[haora...@gmail.com](mailto:haora...@gmail.com)  
> > \<javascript:\>\> wrote:
> > 
> > > Would this start building the doc values structure for new documents  
> > > indexed and not prior docs?
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/189c9ede-cd7f-408e-8bf2-08a858d452be%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > Adrien Grand
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF\_Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF_Q%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF\_Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4-hATPP35%3DVf3JTxYOoa5TS8LssSUHnsbv6nzu2YvF_Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f6987dcd-e644-4b6c-96f0-40e0999a6b0a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f6987dcd-e644-4b6c-96f0-40e0999a6b0a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:28am UTC](https://discuss.elastic.co/t/safe-to-set-doc-values-true-on-existing-index/22502/9 "2017-07-06T00:28:12Z")

</div>


