When we initially started using Elasticsearch we missed to add mappings to one of our indices. So all the Fields are having default type of "keyword". Is there any way to perform the date range search by interpreting timestamp field as date type during search?. Mapping:
{
"index_01_2022": {
"mappings": {
"properties": {
"starttime": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"timestamp": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
required search query:
{
"query": {
"bool": {
"filter": {
"range": {
"timestamp": {
"gte": "2022-01-01T00:00:00",
"lte": "2022-01-02T00:00:00"
}
}
}
}
}
}