From e05dee6df53fc5685f7e243e8183f3d8559e7f67 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 29 Mar 2021 12:06:51 +0200 Subject: [PATCH] allow sorting by housenumbers for rare street names Usually we don't narrow down search results by house number when only a street name is given because there may be a lot of rows to cross check when the street name is very frequent. However, when it is known to be rare, the housenumber check may be done anyway. Fixes #2238. --- lib-php/SearchDescription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib-php/SearchDescription.php b/lib-php/SearchDescription.php index 228b0999..2b39443f 100644 --- a/lib-php/SearchDescription.php +++ b/lib-php/SearchDescription.php @@ -614,7 +614,7 @@ class SearchDescription // too many results are expected for the street, i.e. if the result // will be narrowed down by an address. Remeber that with ordering // every single result has to be checked. - if ($this->sHouseNumber && (!empty($this->aAddress) || $this->sPostcode)) { + if ($this->sHouseNumber && ($this->bRareName || !empty($this->aAddress) || $this->sPostcode)) { $sHouseNumberRegex = '\\\\m'.$this->sHouseNumber.'\\\\M'; $aOrder[] = ' ('; $aOrder[0] .= 'EXISTS('; -- 2.45.1