CityOfPhiladelphia / ais

Address Information System
19 stars 8 forks source link

Proposal: have 404s return nearest match #126

Open bertday opened 7 years ago

bertday commented 7 years ago

A Property Search user reported that "searches are not working" when searching for this block:

http://property.phila.gov/?bn=600&bs=Archer%20St

That block doesn't seem to exist, but it makes sense that the error in Property Search ("Failed to retrieve results. Please try another search.") sounds like something's not working on the back end. Should we alter 404 errors in AIS to return the nearest match so that a more helpful message can be displayed, e.g. "Did you mean 3800 Archer St"?

/cc @Alexander-M-Waldman @tswanson

Alexander-M-Waldman commented 7 years ago

Yes, @rbrtmrtn it seems that this would be helpful for users. It can be easily implemented when the nearest seg is returned by Passyunk, but currently this is limited to queries that are within 200 address numbers from a nearest seg. @tswanson how do you feel about removing the address number "distance" constraint in Passyunk to facilitate this?

Alexander-M-Waldman commented 7 years ago

Actually returning the nearest match is beyond Passyunk's matching to nearest actual street segment number; this would entail finding an existing address even if the query returns a seg match but no address match. I will consider a solution @rbrtmrtn @tswanson.

tswanson commented 7 years ago

@rbrtmrtn @Alexander-M-Waldman are you asking to increase the passyunk 200 address number? What should it be? 500 Without a constraint we were getting weird result

bertday commented 7 years ago

I see it as something that belongs more in AIS than Passyunk. My thought was to have it return the nearest match regardless of how far off it is. There will be some false positives but I think it's more important for the API to feel predictable than to always have a reasonable answer. That said, I think developers also need to know the implications of a nearest match and we should probably add something to our documentation to recommend confirming these with the end user (e.g. show a popup "Did you mean 3000 ARCHER ST?" rather than just zooming to it). But I think overall this will lead to a more positive experience in Property and other apps.