I am doing a query on data in python,
When I just do a match and sort it works fine.
res = es.search( body={"size" : 100,
"query": {"match": {"SensorId": "f0038c53272a"}},
"sort":{"StartDateTime": "desc"}})
Now when I introduce range, it starts giving an error
res = es.search( body={"size" : 100,
"query": {"match": {"SensorId": "f0038c53272a"}},
"sort":{"StartDateTime": "desc"},
"range":{"StartDateTime":{"gte":"now-50d/d","lt": "now/d"}}})
The error it throws is
elasticsearch.exceptions.RequestError:
TransportError(400, 'search_phase_execution_exception',
'No mapping found for [StartDateTime] in order to sort on')
Elasticsearch version is 2.3. Any clue would be helpful.