Getting error No mapping found for [logdata.timestamp] in order to sort on"
{
"dynamic": "false",
"_meta": {
"version": 2,
"updateTimeInMs": 1607537203813
},
"properties": {
"log": {
"properties": {
"logid": {
"type": "keyword"
},
"logdata": {
"type": "text",
"index": false
},
"timestamp": {
"type": "date"
},
"version": {
"type": "integer",
"index": false,
"doc_values": false
}
}
}
}
}
and i am using to fetch the results Note:- Fields logid and timestamps are indexed
{
"from": 0,
"size": 1000,
"query": {
"bool": {
"must": [
{
"term": {
"logid": {
"value": "1",
"boost": 1.0
}
}
},
{
"range": {
"timestamp": {
"from": 1607212800,
"to": 1607299200,
"include_lower": true,
"include_upper": true,
"boost": 1.0
}
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
},
"sort": [
{
"timestamp": {
"order": "asc"
}
}
]
}