Hi Everyone,
I want to implement proximity search in ES 5.0.0 using Geo-Distance queries. The syntax is the same as specified in the ES 5.0 documentation but still I am getting an error.
Looking forward to get help on this .....
My Query (testsfdc is my index which stores all customer records with a field location(lat,lon)
GET /testsfdc/_search
{
"query": {
"bool": {
"must": [
{"match_all": {}}
]
},
"filter":{
"geo_distance": {
"distance": 10,
"distance_unit": "km",
"location": {
"lat": 50.4724833,
"lon": 4.8179051
}
}
}
}
}
Error -
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[bool] malformed query, unexpected [FIELD_NAME] found [filter]",
"line": 8,
"col": 7
}
],
"type": "parsing_exception",
"reason": "[bool] malformed query, unexpected [FIELD_NAME] found [filter]",
"line": 8,
"col": 7
},
"status": 400
}
I know the error says syntax before "filter" is wrong but I tried playing around but in vain.
Thanks in advance,
Surbi