I think the problem is because the value is '2020-02-25 12:12:12' so I tried with format
Y-m-d H:m:s
But return error
mapper [date] of different type, current_type [text], merged_type [date]
Maybe the problem is because I didn't save the date with 'T' word, in this case how can I update all values to include a 'T' between date and time? Any idea or advice to fix my fail?
I can't reset the index and start again....
Thanks
The mapping for a field cannot be changed from text to date; you will need to reindex data into a new index that has the "date" field set as a date data type.
Take a look at the built-in formats for date; there's probably an existing format (or formats; multiple can be specified using || separator) that you can use.
Hey! Apologize for typing back.
The solution doesn't work. I'm trying to filter by range but returns values which doesn't correspond with the expected.
I created a template:
I don't think this format would match for "date" : "2020-01-17 12:12:12". The response from the _reindex call indicates how many documents were created and failed - did the response indicate failures when attempting to parse dates with the format?
The value that you specify for "format" in the mapping is the one that Elasticsearch uses to parse the incoming date string. Based on the example provided, I think the format you want is
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.