X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/cd9b0c9a201e383a2cc0ae22efa247d9107eee7f..04644102f2721d6fa6fbb86af8fb7ad8267add56:/lib-php/SearchDescription.php diff --git a/lib-php/SearchDescription.php b/lib-php/SearchDescription.php index fbf6b650..3f3beab1 100644 --- a/lib-php/SearchDescription.php +++ b/lib-php/SearchDescription.php @@ -264,6 +264,8 @@ class SearchDescription { if (empty($this->aName)) { $this->bNameNeedsAddress = $bNeedsAddress; + } elseif ($bSearchable && count($this->aName) >= 2) { + $this->bNameNeedsAddress = false; } else { $this->bNameNeedsAddress &= $bNeedsAddress; } @@ -642,6 +644,7 @@ class SearchDescription // Housenumbers on streets and places. $sPlacexSql = 'SELECT array_agg(place_id) FROM placex'; $sPlacexSql .= ' WHERE parent_place_id = sin.place_id AND sin.address_rank < 30'; + $sPlacexSql .= $this->oContext->excludeSQL(' AND place_id'); $sPlacexSql .= ' and housenumber ~* E'.$sHouseNumberRegex; // Interpolations on streets and places.