mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
link nodes and relations using name->'name' index lookup instead of search_name
This commit is contained in:
@@ -1532,14 +1532,14 @@ BEGIN
|
|||||||
|
|
||||||
-- not found one yet? how about doing a name search
|
-- not found one yet? how about doing a name search
|
||||||
IF NEW.centroid IS NULL THEN
|
IF NEW.centroid IS NULL THEN
|
||||||
FOR linkedPlacex IN select placex.* from search_name join placex using (place_id) WHERE
|
FOR linkedPlacex IN select placex.* from placex WHERE
|
||||||
search_name.name_vector @> ARRAY[getorcreate_name_id(make_standard_name(NEW.name->'name'))]
|
make_standard_name(name->'name') = make_standard_name(NEW.name->'name')
|
||||||
AND search_name.search_rank = NEW.rank_search
|
AND placex.rank_search = NEW.rank_search
|
||||||
AND search_name.place_id != NEW.place_id
|
AND placex.place_id != NEW.place_id
|
||||||
AND osm_type = 'N'
|
AND osm_type = 'N'
|
||||||
AND NEW.name->'name' = placex.name->'name'
|
|
||||||
AND st_contains(NEW.geometry, placex.geometry)
|
AND st_contains(NEW.geometry, placex.geometry)
|
||||||
LOOP
|
LOOP
|
||||||
|
|
||||||
-- If we don't already have one use this as the centre point of the geometry
|
-- If we don't already have one use this as the centre point of the geometry
|
||||||
IF NEW.centroid IS NULL THEN
|
IF NEW.centroid IS NULL THEN
|
||||||
NEW.centroid := coalesce(linkedPlacex.centroid,st_centroid(linkedPlacex.geometry));
|
NEW.centroid := coalesce(linkedPlacex.centroid,st_centroid(linkedPlacex.geometry));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ CREATE INDEX idx_placex_pendingsector ON placex USING BTREE (rank_search,geometr
|
|||||||
CREATE INDEX idx_placex_parent_place_id ON placex USING BTREE (parent_place_id) where parent_place_id IS NOT NULL;
|
CREATE INDEX idx_placex_parent_place_id ON placex USING BTREE (parent_place_id) where parent_place_id IS NOT NULL;
|
||||||
CREATE INDEX idx_placex_interpolation ON placex USING BTREE (geometry_sector) where indexed_status > 0 and class='place' and type='houses';
|
CREATE INDEX idx_placex_interpolation ON placex USING BTREE (geometry_sector) where indexed_status > 0 and class='place' and type='houses';
|
||||||
CREATE INDEX idx_placex_sector ON placex USING BTREE (geometry_sector,rank_address,osm_type,osm_id);
|
CREATE INDEX idx_placex_sector ON placex USING BTREE (geometry_sector,rank_address,osm_type,osm_id);
|
||||||
|
CREATE INDEX idx_placex_adminname on placex USING BTREE (make_standard_name(name->'name'),rank_search) WHERE osm_type='N' and rank_search < 26;
|
||||||
CREATE INDEX idx_location_area_country_place_id ON location_area_country USING BTREE (place_id);
|
CREATE INDEX idx_location_area_country_place_id ON location_area_country USING BTREE (place_id);
|
||||||
|
|
||||||
CREATE INDEX idx_search_name_country_centroid ON search_name_country USING GIST (centroid);
|
CREATE INDEX idx_search_name_country_centroid ON search_name_country USING GIST (centroid);
|
||||||
|
|||||||
Reference in New Issue
Block a user