In the Using explicit mapping creation recipe, we have seen how Elasticsearch is able to guess the field type using reflection. In this recipe, we'll see how we can help it improve its guessing capabilities via dynamic templates.
The dynamic template feature is very useful. For example, it may be useful in situations in which you need to create several indices with similar types because it allows you to move the need to define mappings from coded initial routines to automatic index-document creation. A typical usage is to define types for Logstash log indices.