X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/890d415e1ffd997d11ed35dee04cb01b94ca133f..0b0349f746fccd572b1c8a4911cc131ffbe9597e:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index 9e02150c..55dd46e7 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -245,7 +245,6 @@ class Geocode } $this->oPlaceLookup->loadParamArray($oParams, $sForceGeometryType); - $this->oPlaceLookup->setIncludePolygonAsPoints($oParams->getBool('polygon')); $this->oPlaceLookup->setIncludeAddressDetails($oParams->getBool('addressdetails', false)); } @@ -348,10 +347,7 @@ class Geocode $aNewPhraseSearches = array(); $sPhraseType = $bIsStructured ? $oPhrase->getPhraseType() : ''; - foreach ($oPhrase->getWordSets() as $iWordSet => $aWordset) { - // Too many permutations - too expensive - if ($iWordSet > 120) break; - + foreach ($oPhrase->getWordSets() as $aWordset) { $aWordsetSearches = $aSearches; // Add all words from this wordset @@ -641,7 +637,6 @@ class Geocode } } - Debug::printDebugTable('Phrases', $aPhrases); Debug::printVar('Tokens', $aTokens); $oValidTokens = new TokenList(); @@ -686,6 +681,11 @@ class Geocode Debug::printGroupTable('Valid Tokens', $oValidTokens->debugInfo()); + foreach ($aPhrases as $oPhrase) { + $oPhrase->computeWordSets($oValidTokens); + } + Debug::printDebugTable('Phrases', $aPhrases); + Debug::newSection('Search candidates'); $aGroupedSearches = $this->getGroupedSearches($aSearches, $aPhrases, $oValidTokens, $bStructuredPhrases); @@ -807,9 +807,7 @@ class Geocode $sSQL .= 'WHERE place_id in ('.$sPlaceIds.') '; $sSQL .= ' AND ('; $sSQL .= " placex.rank_address between $this->iMinAddressRank and $this->iMaxAddressRank "; - if (14 >= $this->iMinAddressRank && 14 <= $this->iMaxAddressRank) { - $sSQL .= " OR (extratags->'place') = 'city'"; - } + $sSQL .= " OR placex.rank_search between $this->iMinAddressRank and $this->iMaxAddressRank "; if ($this->aAddressRankList) { $sSQL .= ' OR placex.rank_address in ('.join(',', $this->aAddressRankList).')'; } @@ -906,12 +904,6 @@ class Geocode $aResult = array_merge($aResult, $aOutlineResult); } - if ($aResult['extra_place'] == 'city') { - $aResult['class'] = 'place'; - $aResult['type'] = 'city'; - $aResult['rank_search'] = 16; - } - // Is there an icon set for this type of result? $aClassInfo = ClassTypes\getInfo($aResult);