Skip to content

Rank by distance #358

@cderenburger

Description

@cderenburger

I have a feature request to add the ability to rank results by distance not limited to a radius.

Problem: I have certain zipcodes covering large rural areas. In one case the main city is on the northern border of the zipcode. When performing a search using the zipcode no results are shown as the city is outside of the radius. I can manually specify &radius=50 and it will show results from the city, but also from other cities from a geographically separated area or from cities in another county where the user would not be served.

The other problem with limiting to a particular radius is that some services may serve the state, but be located hundreds of miles away. For example we have a statewide legal hotline with an office in one location, but a radius search would be too limited for appear in the search results for users throughout much of the state.

My services do have service_areas defined by counties. The statewide legal service for instance would list itself as serving all counties. If there were a way to sort results distance (nearest->farthest) that is not limited by distance I would be able to get the desired search results.

I noticed from here b45e1fc that you needed to define an order to get consistent results. Would it be possible to specify a rankby= query parameter that could sort by newest, distance, alphabetical, or other parameters? With other parameters you could for example designate promoted services that would always appear first in the results list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions