Hi,
I have an index in which I have a point field that holds the geolocation of the place, and I have a user interface on the frontend where the user can move the map and he will get the top 10 nearest location, everything is ok till now.
But the problem is that when the user scrolls down and reaches the end of the page, I need to fetch the next 10 nearest locations. How can I achieve this feature?
how to use the search_after for this one scenario
my query is :
{
"size": 10,
"query": {
"terms": {
"type": [
"hotel",
"restaurent"
]
}
},
"sort": [
{
"_geo_distance": {
"points": {
"lat": latpoint,
"lon": lonpoint
},
"order": "asc",
"unit": "km",
"mode": "min",
"distance_type": "arc",
"ignore_unmapped": true
}
}
]
}