When a POI gets parented to a street, for example because it is a node on that street, and the street has no name, then the POI is only searchable by its name. The nameaddress_vector in the search_name table remains empty.
Example: https://nominatim.openstreetmap.org/ui/details.html?osmtype=N&osmid=8795855155&keywords=1
The reason for that is how we handle POI addresses in create_poi_search_terms. The first step is to retrieve the search terms for the parents:
|
SELECT s.name_vector, s.nameaddress_vector |
|
INTO parent_name_vector, parent_address_vector |
|
FROM search_name s |
|
WHERE s.place_id = parent_place_id; |
An unnamed street has no entry in search_name, so the variables are all set to NULL and the cheating further down
|
-- Cheating here by not recomputing all terms but simply using the ones |
|
-- from the parent object. |
|
nameaddress_vector := array_merge(nameaddress_vector, parent_name_vector); |
|
nameaddress_vector := array_merge(nameaddress_vector, parent_address_vector); |
doesn't work as expected.
If nothing is found, and the POI needs to be searchable (has name or housenumber), then the code should look up the address objects of the parent in place_addressline, retrieve their name_vector entries from search_name and merge them together to make up the nameaddress_vector.
Fix should come with a BDD test in features/db/import/search_name.feature that describes the situation.
When a POI gets parented to a street, for example because it is a node on that street, and the street has no name, then the POI is only searchable by its name. The
nameaddress_vectorin thesearch_nametable remains empty.Example: https://nominatim.openstreetmap.org/ui/details.html?osmtype=N&osmid=8795855155&keywords=1
The reason for that is how we handle POI addresses in
create_poi_search_terms. The first step is to retrieve the search terms for the parents:Nominatim/lib-sql/functions/placex_triggers.sql
Lines 412 to 415 in 6f74afe
An unnamed street has no entry in
search_name, so the variables are all set to NULL and the cheating further downNominatim/lib-sql/functions/placex_triggers.sql
Lines 464 to 467 in 6f74afe
doesn't work as expected.
If nothing is found, and the POI needs to be searchable (has name or housenumber), then the code should look up the address objects of the parent in
place_addressline, retrieve theirname_vectorentries fromsearch_nameand merge them together to make up the nameaddress_vector.Fix should come with a BDD test in
features/db/import/search_name.featurethat describes the situation.