Add normalized form of country names to coutry tokens in word table #3894
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Country tokens were the only ones not yet having the normalised form of the word to allow rematching against the query. This has repeatedly caused country results being pushed to the top of the result list when matching against some odd translation of the country name.
This PR shifts information in the country token around a bit. 'word' now contains the normalized name just like in all the other token types. The country name has moved into the info field.
There is a migration to switch to the new token format but it will only insert internal country names. If you want to also have the names imported from OSM run the SQL query
update placex set indexed_status = 2 where class = 'boundary' and type = 'administrative' and rank_address = 4followed by anominatim --index.Fixes #3879.