-
-
Notifications
You must be signed in to change notification settings - Fork 165
Enable autocomplete for postalcodes #1514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
huh actually works pretty well @orangejulius @Joxit thoughts? |
Joxit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I did some acceptance-tests, no regression and this will improve UX on postalcode autocomplete !
This adds autocomplete tests specifically around postalcode behavior. Most of them were missed and I actually meant to commit them as part of #544. Additionally, I've added one more test for an incomplete postalcode, to measure progress against pelias/pelias#676. We may be able to improve results with pelias/api#1514
|
Oh, very nice. This has been really annoying for a long time. We've had the issue reported in the past going all the way back to 2017 pelias/pelias#676 I just added another acceptance test for this in pelias/acceptance-tests#545 and i'll follow up with a bit more testing. |
Could you please post some examples. |
|
Ok, still investigating and making sure the differences I'm seeing aren't from differences in test settings/etc, but it looks like the differences aren't that major. Here's one that's a little confusing: autocomplete takes a couple more characters to get https://pelias.github.io/compare/#/v1/autocomplete?text=30+w+26 It looks like this query has replaced the second of two Very preliminary results so far, stay tuned for more :) |
|
Hmm yeah that is weird, I'm on mobile ATM but I can't see the layers listed in the debug output. The PR targets the |
|
Adding |
|
I'm back at the keyboard again now and added this commit which seems to have done the trick 63c168c @orangejulius does that fix the issues you were seeing? |
It shouldn't affect any address queries because if the The change of behaviour only applies when |
|
This query confuses me, since it's explicitly targeting the It's not actually bad, just not what I was expecting and might indicate a bug or that I've missed something. |
|
Some test cases to consider before merging. |
63c168c to
6b085e8
Compare
|
rebased |
|
After rebasing and manually reviewing the cases I mentioned above I don't see any regressions. |
|
We can merge this once we review the differences for the tests in pelias/acceptance-tests#549 and confirm they are positive and no major regressions. |
6b085e8 to
0778fd2
Compare
|
I rebased again and reviewed the test cases linked above, there were three changes: 1x improvementhttps://pelias.github.io/compare/#/v1/autocomplete?layers=postalcode&boundary.country=USA&text=9021 2x regressionshttps://pelias.github.io/compare/#/v1/autocomplete?boundary.country=FRA&text=03100 https://pelias.github.io/compare/#/v1/autocomplete?boundary.country=USA&text=04106 |
|
For the vast majority of cases it's a marked improvement 🎉 The sorting is quite interesting:
|
|
hmm... I think maybe I'm getting confused since I've been away from work for a while. The problem with the second two queries is they don't specify When adding |
0778fd2 to
2ab2149
Compare
|
I just updated this PR with some new commit messages to provide a better "high level" context of the change, rather than the development-focused explanation that was originally present. The original commits are preserved in an archive branch. Here's what I wrote for the explanation, hopefully it's clear and helpful as it will appear in the Pelias API release notes:
|
2ab2149 to
32b6c39
Compare
Enable support for autocompleting postalcode by relaxing constraints around when we allow partial matches on numeric inputs. Historically, Pelias has not allowed the `text` parameter input to match a "partial" result when the entire input consists only of numbers. Considering there are often _lots_ of results that could match a numeric input like `1`, `10`, or even `1014`, and most of them are addresses that have little chance of being relevant, this approach isn't without merit. However postalcodes are another possible match, and people want to search for them reasonably often. They also often consist purely of numbers. So this change allows those numeric partial matches when the `address` layer _won't_ be queried. Thanks to some of our performance optimizations, this will always be the case for short inputs like `text=1234` as long as the `layers` parameter is unset or doesn't explicitly contain the address layer. In practice, what this means is that a query like `text=9021` will now result in the `90210` US postalcode first, whereas previously it would return a bunch of irrelevant venue results scattered around the world.
32b6c39 to
f060140
Compare
I tried to do a
/v1/autocompletefor a partial postalcode with?layers=postalcodetoday and discovered that it doesn't return anything until the final character has been typed.This DRAFT PR is a simple attempt at maybe fixing that
Would require more unit tests and some reasonable level of perf/recall/precision testing to get merged.