(Custom) Answers for providers: Can I add search by geolocation and radius?

I have a very custom Answers experience: one that has a custom card, configuration, and only using one vertical.
I want to

  1. show radius distance on the provider cards
  2. have a radius facet/filter
  3. Want to be able to search for geolocation (coordinates), i.e. “40.6892° N, 74.0445° W” as a search, and have the closest lcation pop up.

Is this possible?

Hi Emily,

  1. Radius distance is shown on the location-standard card. I would copy this over to your provider card. You’ll need the {{ > distance }} partial in the template.hbs file (remember to copy the reference in the card structure at the top and where the partial is defined down below) and the distance property in the component.js file.


It should look like the location-standard card:

  1. You can add a static filter for radius by following the bottom of the Implementing Static Filters unit. Since you only have one vertical, you’ll want to make sure that vertical page is set up as index.html (see instructions here).

  2. This is not currently possible. Is this client seeing users search by location coordinates? From what we’ve seen, this is not common. You can submit this to the Ideas board and be sure to also include context on why or how frequently users are searching by coordinates.

1 Like

As a follow-up for this, are we able to perform zipcode searches? i.e. search “11791” on Answers?

Hi @Emily_Gruber,

I think @Ebuka_Imachukwu had been working on something similar. Ebuka - can you share some best practices about zip code search here?

Thank you!

Hi @Emily_Gruber ,

You can perform zip code searches by adding address.postalCode as a searchable field and placing an NLP Filter on it. Because Answers prioritizes the builtin.location field, which should also have an active NLP filter, I’d recommend adding nlpFilterOrder logic in the backend configuration and setting the address.postalCode field above it.

Hope this helps!