mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 01:47:57 +00:00
Indexing: manage the case where no default-language exists
Relates-to commit 6fee784c9f.
This commit is contained in:
@@ -29,7 +29,7 @@ DECLARE
|
|||||||
location RECORD;
|
location RECORD;
|
||||||
result prepare_update_info;
|
result prepare_update_info;
|
||||||
extra_names HSTORE;
|
extra_names HSTORE;
|
||||||
default_language_key VARCHAR(10);
|
default_language VARCHAR(10);
|
||||||
BEGIN
|
BEGIN
|
||||||
IF not p.address ? '_inherited' THEN
|
IF not p.address ? '_inherited' THEN
|
||||||
result.address := p.address;
|
result.address := p.address;
|
||||||
@@ -87,10 +87,12 @@ BEGIN
|
|||||||
IF location.name is not NULL THEN
|
IF location.name is not NULL THEN
|
||||||
{% if debug %}RAISE WARNING 'Names original: %, location: %', result.name, location.name;{% endif %}
|
{% if debug %}RAISE WARNING 'Names original: %, location: %', result.name, location.name;{% endif %}
|
||||||
|
|
||||||
-- Merge in a default-language name from the linked place, if none is set
|
default_language := get_country_language_code(location.country_code);
|
||||||
default_language_key := 'name:' || get_country_language_code(location.country_code);
|
IF default_language is NULL OR location.name ? ('name:' || default_language) THEN
|
||||||
IF NOT location.name ? default_language_key THEN
|
-- No default language, or a name in the local language is already configured; do nothing
|
||||||
location.name := location.name || hstore(default_language_key, location.name->'name');
|
ELSE
|
||||||
|
-- Merge in a default-language name from the linked place
|
||||||
|
location.name := location.name || hstore('name:' || default_language, location.name->'name');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- Add all names from the place nodes that deviate from the name
|
-- Add all names from the place nodes that deviate from the name
|
||||||
|
|||||||
Reference in New Issue
Block a user