Leave search ambiguous when parse is ambiguous between street & place#1430
Leave search ambiguous when parse is ambiguous between street & place#1430blackmad wants to merge 2 commits into
Conversation
|
this has some unit test failures I missed yesterday. closing for now. |
|
I just stumbled upon this PR, I must have missed it when it was originally made. While I can't comment on the technical approach (@missinglink , what do you think?), this does at least attempt to solve a legitimate scoring issue, which is that the API, when told by the Pelias parser an input is possibly Even with substantial popularity boosts for Wrigley Field (from pelias/openstreetmap#531), the street still comes up first in results for this reason. Maybe we re-visit this soon and figure out a way to finish it off? We would be looking pretty good on the Wrigley Field test if we can make progress on that last character: |

This change was based on a suggestion by @missinglink to fix "wrigley field" - since field can be both a street suffix and a place suffix, perhaps we should not boost either place or street matches if the parser is unsure.
This change attempts to do that by checking if the top two parses are entirely tagged as a street and entirely tagged as a place, and if so, doesn't accept either parse and instead does a general subject search.
In reality, I had a hard time figuring out if a parse tagged the entire query - in the case of ', wrigley field ,' I couldn't figure out what signal code be used to understand that every token in the query had been tagged. So, as a proxy, this just checks that the top two parses annotated the same parts of the query as street and venue.
This has the nice benefit of helping phoenix airport - that is the only acceptance-test change from this patch (wrigley field works in both master & in this change after adding 'field' to place_names in parser).