when I apply a date filter, I get this error, my data is correct (when checked from individual index)
Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"parse_exception","reason":"failed to parse date field [11/01/2019] with format [strict_date_optional_time||epoch_millis]: [failed to parse date field [11/01/2019] with format [strict_date_optional_time||epoch_millis]]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"masterdata_sutton","node":"GmJc3-wgQPe3-BzzbdkccQ","reason":{"type":"parse_exception","reason":"failed to parse date field [11/01/2019] with format [strict_date_optional_time||epoch_millis]: [failed to parse date field [11/01/2019] with format [strict_date_optional_time||epoch_millis]]","caused_by":{"type":"illegal_argument_exception","reason":"failed to parse date field [11/01/2019] with format [strict_date_optional_time||epoch_millis]","caused_by":{"type":"date_time_parse_exception","reason":"date_time_parse_exception: Failed to parse with all enclosed parsers"}}}}]},"status":400}
Today I also found the solution @adwaitjoshi. For my case, I do not use date format in the index mapping, I just use the same format date that the TIMESTAMP field has in the doc. And it's working.
Here you can include an extra line "format" and write the time range of "gte" and "lte" according to the time format you prefer (mine is as aforementioned above "format": "dd-MM-yyyy"). This API will return the results with your "your_time_field" format as you have stated regardless of how the time format has been registered in the index.
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.