Elasticsearch 7.3.0 - Mapping Specific Fields


I may be missing this in the documentation, so forgive me.

I want a template that specifies a handful of fields so unwanted fields aren't indexed, in order to save disk space. However, I don't want to explicitly define types for those fields; I just want the default types.

Is there a way to accomplish this?



there is not a way to do is, because it is still unsafe. Imagine you had this possibility in combination with dailiy indices. On day 1 the first document contains a 1 as a number (possibly resulting in a short), and on day 2 the first document contains a 3458345643 (an int) and on day 3 it will be abcdef ending up in a string. You would again end up with an arbitrary mapping, just within the limitation of known fields.

If I was responsible for that cluster, I would just go with a solid preconfigured mapping and then decide what to do with unknown fields: either ignoring them or throwing an exception on indexation.

Hope this helps!

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