Short of creating a new index with the desired mapping and then transferring all the data from the old index to the new one, how can I update the date format of an existing field?
You can not update an existing field.
You can create a new field with the settings you want to use though.
If you need to update an existing field, you need to create a new index with the mapping you want to have and reindex all your data. The reindex API might help.
Thanks for your reply. I tried re-indexing, but received many errors with similar messages:
{
"index": "gaze_new",
"type": "_doc",
"id": "fVj-8WwBPESVc1yT9rFL",
"cause": {
"type": "mapper_parsing_exception",
"reason": "failed to parse field [Timestamp] of type [date] in document with id 'fVj-8WwBPESVc1yT9rFL'",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "failed to parse date field [2019-09-02T14:18:35.1714475 02:00] with format [yyyy-MM-dd'T'HH:mm:ssZ]",
"caused_by": {
"type": "date_time_parse_exception",
"reason": "Text '2019-09-02T14:18:35.1714475 02:00' could not be parsed at index 19"
}
}
},
"status": 400
}
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.