i am new to elasticsearch and currently looking for distance query on results of query_string: Here is my code:
doc = {
"query": {
"query_string": {
"query": term,
"fields": ['name', 'business_name', 'email', 'city',
'state', 'zip_code', 'business_keywords', 'phone_number',
'address', 'country'
],
},
"filter": {
"geo_distance": {
"distance": radius,
"distance_unit": "km",
"distance_type": "arc",
"location": {
"lat": latitude,
"lon": longitude
}
}
}
}
}
search_response = client.search(index="b",body=doc)
but i am getting the following error :
RequestError: TransportError(400, u'search_phase_execution_exception', u'failed to parse search source. expected field name but got [START_OBJECT]') Any idea ??