My team is looking for ways to optimize large elasticsearch indices by reducing the index footprint.
I read this article about Dynamic Mapping and was wondering if it can be used in order to reduce index footprint (I know that this is also the default mapping configuration in ElasticSearch).
By using Dynamic Mapping, we add certain fields only to documents that really use it (rather than adding it to all documents).
For cases where most documents don't use a certain property we can potentially reduce index size significantly, right?
So if - for example - we may have a basic document mapping that includes "first_name", "last_name" and "main_email". However, some documents (5%) may also include another field "additional_email".
So why have 4 fields for all documents where we can same quite a lot of space using dynamic mapping (95% of the documents need only 3 fields), right?
Also, using Dynamic Templates we can ensure that the mapping type for dynamically added fields is predefined rather than automatically selected by ElasticSearch (used for "additional_email" in our example above).
Is this use-case valid?
Is this really a way to reduce index footprint?
Are there other effective ways to reduce index footprint?