It handles the case where an alt name is merely a substring of the main name, for example on the Union Square subway stop in OSM:
Alt names like this don't add much value: they don't allow searching on any new terms, but do throw off the scoring. Even when we fix the scoring issue, duplicate alt names that add no value still take up space, so this change should be useful for a while.
The change comes in 2 parts, each in their own commit:
what is intended to be a pure refactoring of the tag mapping logic. Rather than loop through all tags in whatever order they come, start with the tags that can go into name.default, then the other name.* fields, and finally the rest. This makes it easier to write logic that looks for duplicates
the actual change to check for the substring match, which is quite small
I'd be happy to extend this in the future with other near-identical alt names, such as handling Mc Donalds vs McDonalds or ignoring quotes or other special characters like in https://github.com/pelias/api/issues/1488.
This change is an attempt to mitigate scoring penalties applied to documents with alternate names (https://github.com/pelias/openstreetmap/issues/507).
It handles the case where an alt name is merely a substring of the main name, for example on the Union Square subway stop in OSM:
Alt names like this don't add much value: they don't allow searching on any new terms, but do throw off the scoring. Even when we fix the scoring issue, duplicate alt names that add no value still take up space, so this change should be useful for a while.
The change comes in 2 parts, each in their own commit:
name.default
, then the othername.*
fields, and finally the rest. This makes it easier to write logic that looks for duplicatesI'd be happy to extend this in the future with other near-identical alt names, such as handling
Mc Donalds
vsMcDonalds
or ignoring quotes or other special characters like in https://github.com/pelias/api/issues/1488.