I have a question about field types in ES 2.3. I want to index a document with a field of type string and want ES to store it as a double. I created a 'myindex' index with the following mapping:
The weird thing is that when I query the document and ask for that particular field it returns it as a number. If I just query for the document without specifying the field it returns it as a string. I'm confused as to what's going on.
This is a bit confusing. It is due to ES being proactive and knows that you really meant double and not string. ES converts it internally to a float or integer even if you use "123" in the _source, but it can have some strange stuff happen in other situations.
In this case I'm defining in the mapping that the "myfield" field should be a double. I'm wondering if operations like sort or range queries will be done over numbers instead of strings.
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.