'Cast type at index time of document

Once ES has dynamically mapped a type to a specific field, is it possible to automatically cast all future values to this type?

Specifically, I want to do this as part of my bulk upload. I don't care if there's data loss- I just don't want to bother with explicitly defining a mapping.



Solution 1:[1]

Elasticsearch will try to coerce things (mostly for numbers), but it'll ultimately reject documents that don't match the mapping

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mark Walkom