Skip to content

Commit

Permalink
narrow down search by house number when postcode is given
Browse files Browse the repository at this point in the history
Fixes #1034.
  • Loading branch information
lonvia committed May 7, 2018
1 parent b30e2ab commit c555b60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/SearchDescription.php
Expand Up @@ -593,7 +593,11 @@ private function queryNamedPlace(&$oDB, $iMinAddressRank, $iMaxAddressRank, $iLi
$aTerms = array();
$aOrder = array();

if ($this->sHouseNumber && !empty($this->aAddress)) {
// Sort by existence of the requested house number but only if not
// 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)) {
$sHouseNumberRegex = '\\\\m'.$this->sHouseNumber.'\\\\M';
$aOrder[] = ' (';
$aOrder[0] .= 'EXISTS(';
Expand Down

0 comments on commit c555b60

Please sign in to comment.