When I place integer and float into dynamic template I got warning above acknowledgement in Kibana console:
#! Deprecation: match_mapping_type [integer] is invalid and will be ignored: No field type matched on [integer], possible values are [object, string, long, double, boolean, date, binary]
#! Deprecation: match_mapping_type [float] is invalid and will be ignored: No field type matched on [float], possible values are [object, string, long, double, boolean, date, binary]
So I need to understand really if integer and float are supported and how to map them in dynamic template
The match_mapping_type matches on the datatype detected by dynamic field mapping, in other words, the datatype that Elasticsearch thinks the field should have. Only the following datatypes can be automatically detected: boolean, date, double, long, object, string
Recommendation is to use "match_mapping_type": "long" for integer and "match_mapping_type": "double" for float data types.
I made correction to mapping. There is not more any Warning messages at index creation time. The mapping is created according to data type.
However at runtime jave RestClient get Integer instance for long and integer datatype , and Double instance for float and doable datatype . The reason of that seems to me lays in Jackson2 object mapping. When Jackson2 needs to map float or long it does not distinguish the number received by RestClient in Response. The question is how serialized and deserialized Float and Long value using Jackson2 to aviid default Jackson behavior which coverts objects to Integer and Double
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.