Sorting results by location and then alphabetically

We have a healthcare provider client with professionals located at multiple offices who asked if it would be possible to sort their professionals alphabetically.

When I set up alphabetical sort, the experiences loses some of the “provider near me” functionality, because it still showed professionals in alphabetical order regardless of distance. If I set up a series of sorting rules so that it first sorts offices by distance, and then the providers at that office in alphabetical order, it looks good so long as I search “provider near 12345”, but the search “provider” goes back to showing names in strictly distance order.

Is there some solution I am not thinking of where I can have names sorted alphabetically without losing “near me” functionality, or should I present these two options to the client and let them pick what they would prefer?

Images showing different results when config is set up to sort by distance, then alphabetically by last name.


Hey @Sarah_Dougherty confirming that you have the correct approach here with your customer. Let us know which option they select!

Best,
Sam

I emailed the client and described the two options (option 1: sorting provider results alphabetically and option 2: sorting first by distance and then alphabetically). In an absolutely ~scorching~ less than 2 minute reply from the client, she elected to go with option 2. We think this will help facilitate more conversions by presenting patients with the most relevant results in an organized way.

For anyone facing this dilemma in the future, the winning config we went with looks like this:

     "sortBys": [
        {
         "type": "ENTITY_DISTANCE"
        },
        {
          "direction": "ASC",
          "field": "lastName",
          "type": "FIELD"
        }
      ],
1 Like