X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/9a5d5d9aec4cf785c8190c37a3136cf09aca6902..c02bf4986f4c6a820325727fa4b56e54a63c40d6:/lib/SearchDescription.php diff --git a/lib/SearchDescription.php b/lib/SearchDescription.php index f3afaff2..c287c898 100644 --- a/lib/SearchDescription.php +++ b/lib/SearchDescription.php @@ -73,23 +73,6 @@ class SearchDescription && preg_match('/[0-9]+/', $this->sHouseNumber); } - private function poiTable() - { - return 'place_classtype_'.$this->sClass.'_'.$this->sType; - } - - public function countryCodeSQL($sVar) - { - if ($this->sCountryCode) { - return $sVar.' = \''.$this->sCountryCode."'"; - } - if ($this->oContext->sqlCountryList) { - return $sVar.' in '.$this->oContext->sqlCountryList; - } - - return ''; - } - public function hasOperator() { return $this->iOperator != Operator::NONE; @@ -335,6 +318,7 @@ class SearchDescription /////////// Query functions + public function query(&$oDB, &$aWordFrequencyScores, &$aExactMatchCache, $iMinRank, $iMaxRank, $iLimit) { $aPlaceIDs = array(); @@ -450,7 +434,7 @@ class SearchDescription } if ($this->oContext->hasNearPoint()) { $sSQL .= ' WHERE '.$this->oContext->withinSQL('ct.centroid'); - } else if ($this->oContext->bViewboxBounded) { + } elseif ($this->oContext->bViewboxBounded) { $sSQL .= ' WHERE ST_Contains('.$this->oContext->sqlViewboxSmall.', ct.centroid)'; } if ($this->oContext->sqlCountryList) { @@ -869,6 +853,22 @@ class SearchDescription return $aClassPlaceIDs; } + private function poiTable() + { + return 'place_classtype_'.$this->sClass.'_'.$this->sType; + } + + private function countryCodeSQL($sVar) + { + if ($this->sCountryCode) { + return $sVar.' = \''.$this->sCountryCode."'"; + } + if ($this->oContext->sqlCountryList) { + return $sVar.' in '.$this->oContext->sqlCountryList; + } + + return ''; + } /////////// Sort functions