Mapping: Is it possible to set a parameter for a field data type globally

Hello together,

I was researching the documentation of Elasticsearch and also looking StackOverflow &Co but I couldn't find an answer. I will be happy about any hint in any direction.

Questions: Maybe that are not the right questions to ask, for the real use case see below.

  • Is it possible to change the default value of a parameter for a field datatype
    e.g. the default value for "doc_values" for all fields with type "keyword" should be false
  • Is it possible to inherit parameter values

Version: Elasticsearch 6.2.4, but every higher version is also fine.
Data: (relatively) static Data

In this use case assume, we are only using explicit mapping. No fields are dynamically added. (This would be an answer to this question.
This mapping contains a lot of fields (e.g. 100) in different hierarchy levels.
For disk space and performance reasons, we want to disable some features like "doc_values" and "index" for most of the fields.

Assume, there are some fields, which we need to query or sort. (e.g. only three fields).
The goal is not to set the parameters for "doc_values" and "index" on every field. Is there a better way?

There is also a parameter: "enable : false". Could this one help?

For Simplicity, the usecase could be also:
A mapping with 100 fields, and only one field should be indexed.

Thanks a lot in advance.

Kind regards

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