Hi All,
We have created an index that consists of text data type for all fields, but we need to convert timestamp field from text to date (format "2021-01-12 09:19:25.890") but unable to do.
I have tried creating a new index with the correct data type as below
PUT /index-0002
{
"settings" : {
"number_of_shards" : 4,
"number_of_replicas" : 1
},
"mappings" : {
"properties" : {
"filed1" : { "type" : "long"},
"filed2" : { "type" : "text" },
"filed3" : { "type" : "text" },
"filed4": { "type" : "text" },
"timestamp": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss.SSS"
}
}
}
}
migrated data from old to new index using reindex API
POST /_reindex
{
"source": {
"index": "index-0001"
},
"dest": {
"index": "index-0002"
}
}
but once it is done the index data type changed to text instead of date
Please help me resolve this issue.