X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/896199c9d4f9252307b1068cbe94fa8aedfedcf8..77510f4a3bb7a40c85d27ed5c71b20ef79a3aa83:/lib-php/SearchDescription.php diff --git a/lib-php/SearchDescription.php b/lib-php/SearchDescription.php index 65df58ef..b98c2e72 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; } @@ -805,6 +807,7 @@ class SearchDescription $sSQL = 'SELECT geometry FROM placex'; $sSQL .= " WHERE place_id in ($sPlaceIDs)"; $sSQL .= " AND rank_search < $iMaxRank + 5"; + $sSQL .= ' AND ST_Area(Box2d(geometry)) < 20'; $sSQL .= " AND ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon')"; $sSQL .= ' ORDER BY rank_search ASC '; $sSQL .= ' LIMIT 1';