I'm having an index created in elasticsearch 5.0, where it contains data from my MySQL db. There's a field which is a string in my table, which I need it as a double in ES.
So what I did was added the mapping when I created the index for the appropriate field using a PUT:
After I did this, a value which contains numbers after the decimal (ie: 23.23) returns the value properly as a double but where as numbers which has zeros after the decimal (ie: 23.00) returns it as a string itself (ie: 2300).
Where am I going wrong? Any help could be appreciated.
What do you mean by "doesn't return a double value"? Can you show us a Put and Get/Search operation with a document that shows the unexpected behaviour? If you mean that if you
That is to be expected, because Elasticsearch returns the original document exactly as it was entered in the "_source" field.
Other than that, with the above mapping your values should be index as doubles.
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.