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.
This commit is contained in:
Sarah Hoffmann 2022-05-27 16:49:14 +02:00
parent b593fe9c3e
commit 9e4e913bf7

View File

@ -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;
}