How to use the search after after getting the result using the geolocation sort

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
      }
    }
  ]
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.