# Doc Values

**URL:** https://discuss.elastic.co/t/doc-values/22027
**Category:** Elasticsearch
**Created:** [February 7, 2015, 7:30pm UTC](https://discuss.elastic.co/t/doc-values/22027 "2015-02-07T19:30:20Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jbaranick](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jbaranick](https://discuss.elastic.co/u/jbaranick)
#### Post date: [February 7, 2015, 7:30pm UTC](https://discuss.elastic.co/t/doc-values/22027/1 "2015-02-07T19:30:20Z")

</div>

Is there a way to turn doc\_values on cluster wide and override any index specific settings?

--  
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/0f54a59e-7490-4c63-b223-6371fa49719a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0f54a59e-7490-4c63-b223-6371fa49719a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)
#### Post date: [February 7, 2015, 8:02pm UTC](https://discuss.elastic.co/t/doc-values/22027/2 "2015-02-07T20:02:26Z")

</div>

You can update mappings cluster-wide (just post the mapping definition to  
server:9200/\*), but you will need to specify the field names explicitly

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
[Lucene.NET](http://Lucene.NET) committer and PMC member

On Sat, Feb 7, 2015 at 9:30 PM, Joel Baranick [jbaranick@gmail.com](mailto:jbaranick@gmail.com) wrote:

> Is there a way to turn doc\_values on cluster wide and override any index  
> specific settings?
> 
> --  
> 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/0f54a59e-7490-4c63-b223-6371fa49719a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0f54a59e-7490-4c63-b223-6371fa49719a%40googlegroups.com)  
> .  
> 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/CAHTr4Zu7aZudsPYCaMLTJGtngn9%2B3h7qny%2B4fYzksf%3DVrUmEEg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu7aZudsPYCaMLTJGtngn9%2B3h7qny%2B4fYzksf%3DVrUmEEg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jbaranick](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jbaranick](https://discuss.elastic.co/u/jbaranick)
#### Post date: [February 7, 2015, 8:04pm UTC](https://discuss.elastic.co/t/doc-values/22027/3 "2015-02-07T20:04:58Z")

</div>

Got it. What I was hoping for would be a way to force doc\_values to be the only way for fielddata to be stored for all mapping a in the entire cluster without having to update each index. Could this be done with a plugin?

--  
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/67ce9351-f37a-40aa-ad04-c5328140d6fd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/67ce9351-f37a-40aa-ad04-c5328140d6fd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)
#### Post date: [February 7, 2015, 8:09pm UTC](https://discuss.elastic.co/t/doc-values/22027/4 "2015-02-07T20:09:19Z")

</div>

If the indexes have been already created you will have to be creative to  
find those fields that need updating - not familiar with a plugin that can  
do that. A simple client side tool that will grab all mappings from the  
/\_mapping endpoint, change it and send it back should do

For indexes that weren't created yet you can use index templates

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
[Lucene.NET](http://Lucene.NET) committer and PMC member

On Sat, Feb 7, 2015 at 10:04 PM, Joel Baranick [jbaranick@gmail.com](mailto:jbaranick@gmail.com) wrote:

> Got it. What I was hoping for would be a way to force doc\_values to be the  
> only way for fielddata to be stored for all mapping a in the entire cluster  
> without having to update each index. Could this be done with a plugin?
> 
> --  
> 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/67ce9351-f37a-40aa-ad04-c5328140d6fd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/67ce9351-f37a-40aa-ad04-c5328140d6fd%40googlegroups.com)  
> .  
> 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/CAHTr4Zv6pffNZ2nZJMm0ew%2BPeaVX2GaNRoQdSHRXYD-x\_T%2BARA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zv6pffNZ2nZJMm0ew%2BPeaVX2GaNRoQdSHRXYD-x_T%2BARA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jbaranick](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jbaranick](https://discuss.elastic.co/u/jbaranick)
#### Post date: [February 7, 2015, 9:56pm UTC](https://discuss.elastic.co/t/doc-values/22027/5 "2015-02-07T21:56:14Z")

</div>

Thanks. I will look into if I can create a plugin which will automatically enable doc\_values whenever an index is created or updated. This seems like it could be very useful for multitenant clusters.

--  
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/032429bb-38de-40f1-8290-334a4890851d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/032429bb-38de-40f1-8290-334a4890851d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)
#### Post date: [February 7, 2015, 9:57pm UTC](https://discuss.elastic.co/t/doc-values/22027/6 "2015-02-07T21:57:53Z")

</div>

You don't need a plugin for index when an index is created - use index  
templates + dynamic templates for this, e.g.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
[Lucene.NET](http://Lucene.NET) committer and PMC member

On Sat, Feb 7, 2015 at 11:56 PM, Joel Baranick [jbaranick@gmail.com](mailto:jbaranick@gmail.com) wrote:

> Thanks. I will look into if I can create a plugin which will automatically  
> enable doc\_values whenever an index is created or updated. This seems like  
> it could be very useful for multitenant clusters.
> 
> --  
> 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/032429bb-38de-40f1-8290-334a4890851d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/032429bb-38de-40f1-8290-334a4890851d%40googlegroups.com)  
> .  
> 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/CAHTr4ZuKav0hP6G%2BCM55t6r1pYh62%3DOY-eOQarMteEeVyDE7\_w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZuKav0hP6G%2BCM55t6r1pYh62%3DOY-eOQarMteEeVyDE7_w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jbaranick](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jbaranick](https://discuss.elastic.co/u/jbaranick)
#### Post date: [February 8, 2015, 1:44am UTC](https://discuss.elastic.co/t/doc-values/22027/7 "2015-02-08T01:44:38Z")

</div>

Sure. I get that, but I'm talking about a multi-tenant environment where I  
do not control the index templates or mappings which are installed. In  
this scenario it would be nice to be able to configure the cluster to only  
allow field data to be off or doc\_values.

On Saturday, February 7, 2015 at 1:58:00 PM UTC-8, Itamar Syn-Hershko wrote:

> You don't need a plugin for index when an index is created - use index  
> templates + dynamic templates for this, e.g.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html#dynamic-templates)
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> [Lucene.NET](http://Lucene.NET) committer and PMC member
> 
> On Sat, Feb 7, 2015 at 11:56 PM, Joel Baranick \<[jbar...@gmail.com](mailto:jbar...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Thanks. I will look into if I can create a plugin which will  
> > automatically enable doc\_values whenever an index is created or updated.  
> > This seems like it could be very useful for multitenant clusters.
> > 
> > --  
> > 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/032429bb-38de-40f1-8290-334a4890851d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/032429bb-38de-40f1-8290-334a4890851d%40googlegroups.com)  
> > .  
> > 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/96e8dea4-61bf-44bf-b14f-c38702b041f5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/96e8dea4-61bf-44bf-b14f-c38702b041f5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [February 8, 2015, 1:56am UTC](https://discuss.elastic.co/t/doc-values/22027/8 "2015-02-08T01:56:17Z")

</div>

Have a look at [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html#indices-templates)

This will help IMO.

David

> Le 8 févr. 2015 à 02:44, Joel Baranick [jbaranick@gmail.com](mailto:jbaranick@gmail.com) a écrit :
> 
> Sure. I get that, but I'm talking about a multi-tenant environment where I do not control the index templates or mappings which are installed. In this scenario it would be nice to be able to configure the cluster to only allow field data to be off or doc\_values.
> 
> > On Saturday, February 7, 2015 at 1:58:00 PM UTC-8, Itamar Syn-Hershko wrote:  
> > You don't need a plugin for index when an index is created - use index templates + dynamic templates for this, e.g. [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html#dynamic-templates)
> > 
> > --
> > 
> > Itamar Syn-Hershko  
> > [http://code972.com](http://code972.com) | @synhershko  
> > Freelance Developer & Consultant  
> > [Lucene.NET](http://Lucene.NET) committer and PMC member
> > 
> > > On Sat, Feb 7, 2015 at 11:56 PM, Joel Baranick [jbar...@gmail.com](mailto:jbar...@gmail.com) wrote:  
> > > Thanks. I will look into if I can create a plugin which will automatically enable doc\_values whenever an index is created or updated. This seems like it could be very useful for multitenant clusters.
> > > 
> > > --  
> > > 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).  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/032429bb-38de-40f1-8290-334a4890851d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/032429bb-38de-40f1-8290-334a4890851d%40googlegroups.com).  
> > > 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/96e8dea4-61bf-44bf-b14f-c38702b041f5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/96e8dea4-61bf-44bf-b14f-c38702b041f5%40googlegroups.com).  
> 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/9BDEB4CA-55A2-4AB7-BE76-0EBF0B1E2DCA%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/9BDEB4CA-55A2-4AB7-BE76-0EBF0B1E2DCA%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jbaranick](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jbaranick](https://discuss.elastic.co/u/jbaranick)
#### Post date: [February 8, 2015, 5:25am UTC](https://discuss.elastic.co/t/doc-values/22027/9 "2015-02-08T05:25:05Z")

</div>

Great! That does look pretty close. Guessing I could use an index template with order=int.max, set the template to \* and configure the _default_ mapping. Only thing I'm not sure about is how to restrict field data to either off or doc\_values for fields whose names I do not know. Dynamic templates don't seem to work because they only apply if an explicit mapping doesn't exist. Any suggestions on what could be added to an index template which would achieve my goals?

--  
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/83794a3b-5d5c-4f4e-b4cb-043d3d177c56%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/83794a3b-5d5c-4f4e-b4cb-043d3d177c56%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [February 8, 2015, 8:43am UTC](https://discuss.elastic.co/t/doc-values/22027/10 "2015-02-08T08:43:56Z")

</div>

May be some ideas here? [https://github.com/elasticsearch/logstash/blob/v1.4.2/lib/logstash/outputs/elasticsearch/elasticsearch-template.json](https://github.com/elasticsearch/logstash/blob/v1.4.2/lib/logstash/outputs/elasticsearch/elasticsearch-template.json)

David

> Le 8 févr. 2015 à 06:25, Kadaan [jbaranick@gmail.com](mailto:jbaranick@gmail.com) a écrit :
> 
> Great! That does look pretty close. Guessing I could use an index template with order=int.max, set the template to \* and configure the _default_ mapping. Only thing I'm not sure about is how to restrict field data to either off or doc\_values for fields whose names I do not know. Dynamic templates don't seem to work because they only apply if an explicit mapping doesn't exist. Any suggestions on what could be added to an index template which would achieve my goals?
> 
> --  
> 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/83794a3b-5d5c-4f4e-b4cb-043d3d177c56%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/83794a3b-5d5c-4f4e-b4cb-043d3d177c56%40googlegroups.com).  
> 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/371AD867-7ECF-4EF2-96DE-CF33F671FF7B%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/371AD867-7ECF-4EF2-96DE-CF33F671FF7B%40pilato.fr).  
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:34am UTC](https://discuss.elastic.co/t/doc-values/22027/11 "2017-07-06T00:34:19Z")

</div>


