X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b14ce959d9532f192b748b12f6c71f23a9c1a60b..ef98a85b05f02068ada85dd50b15f2e960ca35bc:/lib-php/TokenSpecialTerm.php diff --git a/lib-php/TokenSpecialTerm.php b/lib-php/TokenSpecialTerm.php index 355dbb91..cdd04e6c 100644 --- a/lib-php/TokenSpecialTerm.php +++ b/lib-php/TokenSpecialTerm.php @@ -1,4 +1,12 @@ hasOperator() && $oPosition->isPhrase(''); + return !$oSearch->hasOperator() + && $oPosition->isPhrase('') + && ($this->iOperator != \Nominatim\Operator::NONE + || (!$oSearch->hasAddress() && !$oSearch->hasHousenumber() && !$oSearch->hasCountry())); } /** @@ -66,8 +77,8 @@ class SpecialTerm $iOp = \Nominatim\Operator::NAME; } else { $iOp = \Nominatim\Operator::NEAR; + $iSearchCost += 2; } - $iSearchCost += 2; } elseif (!$oPosition->isFirstToken() && !$oPosition->isLastToken()) { $iSearchCost += 2; }