How to implement Near Me

A user asked this question and then withdrew their post. Re-posting the answer here because I thought it was a valid question that others may have in the future:

Near me can be implemented with a Geo Filter: https://swiftype.com/documentation/app-search/api/search/filters#geo-filters.

"filters": {
    "location": {
      "center": "37.386483, -122.083842",
      "distance": 300,
      "unit": "km"
    }
  }

Pass the user's location in as "center" and then adjust the "distance" and "unit" to whatever you would consider "near".

1 Like