Reputation: 403
I've created an Azure index of "locations", each with a name, address, geography::POINT, etc.
This index is linked to our Azure search, which we use within a Google map. Using the map's current position, I've experimented around with Azure search's geo.distance feature.
Ideally, we could have a happy balance between what location the user searches for, and how close the returned locations are. Example: I search for McDonald's, and the results are ordered based on which McD's is closest.
My understanding is that I need to use $orderby=geo.distance[...], but I don't want distance to be the only deciding factor for results. Right now, if I search for "McDonald's" and pass a longitude/latitude of another nearby location (say, KFC), the first result will be KFC and not McDonald's.
Will I need to set up a scoring profile, or are there some ordeby/filter tricks that I'm missing?
Upvotes: 0
Views: 125
Reputation: 4671
If you're looking to take multiple relevance factors into account (such as textual relevance, distance, freshness, etc.), then setting up a scoring profile is the way to go.
While you can orderby
multiple fields, it's probably not what you want for this scenario.
See Azure Search scoring profiles reference for details on using the scoring profiles.
Upvotes: 1