(Nearby Query)
We are building a search engine where user will type like
-
Restaurant (Category) in Delhi (place)
-
Bar (Category) in Mumbai (place)
We are supposed to search first tag into category and second tag into place.
So the final query would be something like
First we need to get the Lat, Long from places and then make the second query as a nearby from lat long.
"query": "hotel",
"search_fields": {
"category": {}
},
"result_fields": {
"category": {
"raw": {}
},
"name": {
"raw": {}
},
"filters": {
"location": { // our field key
"center": [
(lat, Long) ( this should be dynamic coming from another query. A match with places)
],
"distance": 15,
"unit": "km"
}