From 9e4e913bf7ab000488e7a58f5cac1c7ebedc399b Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 27 May 2022 16:49:14 +0200 Subject: [PATCH] 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. --- lib-php/SearchDescription.php | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.39.5