From: Sarah Hoffmann Date: Fri, 27 May 2022 14:49:14 +0000 (+0200) Subject: allow search for partials consisting of 3 or more words X-Git-Tag: v4.1.0~36^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/9e4e913bf7ab000488e7a58f5cac1c7ebedc399b allow search for partials consisting of 3 or more words The search query builder currently rejects searches for partial names only, when the partial terms are all very frequent to avoid queries that return too many results. This change slightly relaxes the condition to allow the search when there are 3 or more partial terms. With so many terms the number of matches should be managable. --- diff --git a/lib-php/SearchDescription.php b/lib-php/SearchDescription.php index 65df58ef..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; }