Skip to content

POI object parented to an unnamed streets are not searchable by address #4133

Description

@lonvia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions