Elasticsearch template doesnt set doc_value attribute for index mappings


Based on certain suggestion for elastic search performance tunning, we started using doc_value as true for several fields in our index mapping. This attribute appears in index mappings when we create the index with mappings separately. However when we use the same mapping template, the index creation does not set the doc value attribute as per the template in the mappings. Does doc_value attribute needs to be set in different manner while using templates?


What version are you on?

Its 2.1.1 version.

2.X automatically does doc_values for non_analyzed fields.
There's a flag you can pass the mapping API to get these included when you query it, but I can't find it at the moment.

Thanks Mark. That really helps.