Why i should pre-define the fields?

what is the benefit to pre-define the fields while the elastic will identify the fields automatically ?
please need some explanation :slight_smile:

Is this question is about Logstash? or Elasticsearch itself.

For Elasticsearch, Dynamic field mapping is not perfect, and it is difficult in nature.
As Elasticsearch decide the mapping by the first value of the field, it can't distinguish text and keyword (Elasticsearch map string fields as text fields with keyword multi-fields). The first value: 1 could not tell all following value is only integer or containing some float, and the extent is also unkown.

Explicit field mapping is the way to tell Elasticsearch what type of data is comming in future.

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