-
-
Notifications
You must be signed in to change notification settings - Fork 722
-
I recently noticed that "Ain" in https://nominatim.openstreetmap.org/ui/search.html gave in first result "Aisne" (another France admin division). Few days ago, I noticed that now it gives the good result which is well "Ain". I ran an update on my nominatim instance and "Ain" still returns me "Aisne" instead of "Ain". Is there a kind of cache or something that I should clear to see updates ? (for search results ordering) Thanks, |
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment · 7 replies
-
Hard to say without understanding why Aisne was previously the preferred result. Neither the relations of Ain nor Aisne have changed in the last 3 months, so they are certainly not the culprit. Maybe there used to be a place node but this is hard to determine after the fact. Is your instance publicly accessible? |
Beta Was this translation helpful? Give feedback.
All reactions
-
It's private but I can give you debug results ? For Ain and Aisne if it can be useful ? Full planet import with ADMIN style |
Beta Was this translation helpful? Give feedback.
All reactions
-
For Ain :
After pre-filter, Aisne is sorted first for "Ain" search. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I also noticed that "keywords" of Aisne contains "Ain" : "keywords": {
"name": [
{
"id": 2395,
"token": "fr"
},
{
"id": 10748,
"token": "ena"
},
{
"id": 60755,
"token": "02"
},
{
"id": 81189,
"token": "ain"
},
{
"id": 82689,
"token": "02"
},
{
"id": 220541,
"token": "aisne"
},
{
"id": 220542,
"token": "aisne"
},
{
"id": 220543,
"token": "ain"
}, Do you know if it can have an impact in sorting ? Why "Ain" keyword is under "Aisne"? |
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm not surprised that Aisne is in the results because in Greek Aisne is 'Ain' and 'Ain' is 'An'. Fun, isn't it? (the new frontend will not return Aisne for Ain unless you type it in Greek letters but for the frontend you are using Nominatim still returns the result.) Turns out this is a simple matter of requested output languages. Nominatim does a rematch against the input to adapt the result order. When the result comes back in French 'France Metropolaine' matches against 'ain' in both results, so the slightly more important 'Aisne' wins. When results come back in English (probably the indirect default for you when using the browser), then it is 'France Metropolitan' and the rematch works against Ain/Aisne as intended. This issue is also already fixed with the new frontend. |
Beta Was this translation helpful? Give feedback.
All reactions
-
hmm, atm I don't set any accept-language, but indeed if I set This means I need to preset default accept-language even for my french users ? This will probably impact many cities or region results which are translated in english and that will sorted in a different manner. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Using a different language may make it work for Ain but may break it for other queries. This really can only be fixed on the server side. Quick fix would be to change the code at Lines 878 to 881 in 2171b38
to:
This basically gives a much higher prominence to full-word matches. I haven't really tested that, so there might be other unintended side effects. |
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1
-
I can't test that on my server for now because I only use it in production, but do you think it's something that could be tested in the future ? For now, I gonna use an heuristic condition for "Ain" because it's the only rare case I found that does not match to its exact word place (I never use accept-language and I never had any other problem than with this 3-letter place !). |
Beta Was this translation helpful? Give feedback.
All reactions
This discussion was converted from issue #3132 on August 02, 2023 07:27.
I'm not surprised that Aisne is in the results because in Greek Aisne is 'Ain' and 'Ain' is 'An'. Fun, isn't it? (the new frontend will not return Aisne for Ain unless you type it in Greek letters but for the frontend you are using Nominatim still returns the result.)
Turns out this is a simple matter of requested output languages. Nominatim does a rematch against the input to adapt the result order. When the result comes back in French 'France Metropolaine' matches against 'ain' in both results, so the slightly more important 'Aisne' wins. When results come back in English (probably the indirect default for you when using the browser), then it is 'France Metropolitan' and the rematch wor…