Skip to content
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

Strange search behavior because of bad postcode #1955

Closed
murr999888 opened this issue Sep 16, 2020 · 2 comments
Closed

Strange search behavior because of bad postcode #1955

murr999888 opened this issue Sep 16, 2020 · 2 comments

Comments

@murr999888
Copy link

When you enter the search string "Мариуполь Новая Почта", the Nominatim should return a list of post offices (there are many of them).

For each post office, there are corresponding "name" tags:
name: Нова Пошта
name:ru Новая Почта
name:uk Нова Пошта
name:en Nova Poshta

However, the search result is two places that do not match the given criteria.

For search phrases with tags for other languages, it works fine.
Even
"Мариуполь Нова Пошта"
"Мариуполь Nova Poshta"
"Мариуполь Нова Почта"

In the debug output I see that the search string "Мариуполь Новая Почта" is transliterated to "mariupol novaia pochta".
If I enter these characters (mariupol novaia pochta) into the search bar, everything works fine.

The set of tokens is the same in both cases, but the result of the queries is different.

Final query phrases: 0 => 'Мариуполь Новая Почта'
Tokenization
Tokens: ' mariupol' => ' mariupol'
'mariupol' => 'mariupol'
' mariupol novaia' => ' mariupol novaia'
'mariupol novaia' => 'mariupol novaia'
' mariupol novaia pochta' => ' mariupol novaia pochta'
'mariupol novaia pochta' => 'mariupol novaia pochta'
' novaia' => ' novaia'
'novaia' => 'novaia'
' novaia pochta' => ' novaia pochta'
'novaia pochta' => 'novaia pochta'
' pochta' => ' pochta'
'pochta' => 'pochta'

and

Final query phrases: 0 => 'mariupol novaia pochta'
Tokenization
Tokens: ' mariupol' => ' mariupol'
'mariupol' => 'mariupol'
' mariupol novaia' => ' mariupol novaia'
'mariupol novaia' => 'mariupol novaia'
' mariupol novaia pochta' => ' mariupol novaia pochta'
'mariupol novaia pochta' => 'mariupol novaia pochta'
' novaia' => ' novaia'
'novaia' => 'novaia'
' novaia pochta' => ' novaia pochta'
'novaia pochta' => 'novaia pochta'
' pochta' => ' pochta'
'pochta' => 'pochta'

Why?

@lonvia lonvia changed the title Strange search behavior Strange search behavior because of bad postcode Sep 17, 2020
@lonvia
Copy link
Member

lonvia commented Sep 17, 2020

This is one of these cases where a bad postcode really throws off Nominatim.

Somebody has accidentally mapped a bad postcode 'Новая' on this building. This makes Nominatim think that 'Новая' is a valid name for a postcode. In addition, Nominatim does postcode interpolation into the area to compensate for bad post-code coverage. So one of the top interpretations of your search query is "a place called 'Почта' near postcode 'Новая' in 'Мариуполь'". As it happens, the bus stops near the post office now offer a perfect match for this. The actual post office are a worse match because they are not exactly mapped as name:ru=Новая Почта but as something like name:ru=Новая Почта No 13. Nominatim thinks that the missing post office number makes it a worse match.

The fix for this is to be more careful with unconditional postcode interpolation. Not quite sure yet how to do this without making the query expensive.

@murr999888
Copy link
Author

We fixed the wrong tag on building and added alt_name tags with "Новая Почта".
Everything worked correctly.
Thank you, the question is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants