mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
remove reverseInPlan option from Geocode
Disabling query reversal is no longer possible in the configuration, so there is no need to keep this as an option. Reversal is automatically disabled for structured search only.
This commit is contained in:
@@ -18,7 +18,6 @@ class Geocode
|
|||||||
protected $aLangPrefOrder = array();
|
protected $aLangPrefOrder = array();
|
||||||
|
|
||||||
protected $aExcludePlaceIDs = array();
|
protected $aExcludePlaceIDs = array();
|
||||||
protected $bReverseInPlan = true;
|
|
||||||
|
|
||||||
protected $iLimit = 20;
|
protected $iLimit = 20;
|
||||||
protected $iFinalLimit = 10;
|
protected $iFinalLimit = 10;
|
||||||
@@ -61,11 +60,6 @@ class Geocode
|
|||||||
return $this->oNormalizer->transliterate($sTerm);
|
return $this->oNormalizer->transliterate($sTerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setReverseInPlan($bReverse)
|
|
||||||
{
|
|
||||||
$this->bReverseInPlan = $bReverse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setLanguagePreference($aLangPref)
|
public function setLanguagePreference($aLangPref)
|
||||||
{
|
{
|
||||||
$this->aLangPrefOrder = $aLangPref;
|
$this->aLangPrefOrder = $aLangPref;
|
||||||
@@ -262,7 +256,6 @@ class Geocode
|
|||||||
$oParams->getString('country'),
|
$oParams->getString('country'),
|
||||||
$oParams->getString('postalcode')
|
$oParams->getString('postalcode')
|
||||||
);
|
);
|
||||||
$this->setReverseInPlan(false);
|
|
||||||
} else {
|
} else {
|
||||||
$this->setQuery($sQuery);
|
$this->setQuery($sQuery);
|
||||||
}
|
}
|
||||||
@@ -686,7 +679,7 @@ class Geocode
|
|||||||
|
|
||||||
$aGroupedSearches = $this->getGroupedSearches($aSearches, $aPhrases, $oValidTokens, $bStructuredPhrases);
|
$aGroupedSearches = $this->getGroupedSearches($aSearches, $aPhrases, $oValidTokens, $bStructuredPhrases);
|
||||||
|
|
||||||
if ($this->bReverseInPlan) {
|
if (!$this->aStructuredQuery) {
|
||||||
// Reverse phrase array and also reverse the order of the wordsets in
|
// Reverse phrase array and also reverse the order of the wordsets in
|
||||||
// the first and final phrase. Don't bother about phrases in the middle
|
// the first and final phrase. Don't bother about phrases in the middle
|
||||||
// because order in the address doesn't matter.
|
// because order in the address doesn't matter.
|
||||||
@@ -999,7 +992,6 @@ class Geocode
|
|||||||
'Structured query' => $this->aStructuredQuery,
|
'Structured query' => $this->aStructuredQuery,
|
||||||
'Name keys' => Debug::fmtArrayVals($this->aLangPrefOrder),
|
'Name keys' => Debug::fmtArrayVals($this->aLangPrefOrder),
|
||||||
'Excluded place IDs' => Debug::fmtArrayVals($this->aExcludePlaceIDs),
|
'Excluded place IDs' => Debug::fmtArrayVals($this->aExcludePlaceIDs),
|
||||||
'Try reversed query'=> $this->bReverseInPlan,
|
|
||||||
'Limit (for searches)' => $this->iLimit,
|
'Limit (for searches)' => $this->iLimit,
|
||||||
'Limit (for results)'=> $this->iFinalLimit,
|
'Limit (for results)'=> $this->iFinalLimit,
|
||||||
'Country codes' => Debug::fmtArrayVals($this->aCountryCodes),
|
'Country codes' => Debug::fmtArrayVals($this->aCountryCodes),
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ if (!$oParams->hasSetAny($aSearchParams)) {
|
|||||||
$oGeocode = new Nominatim\Geocode($oDB);
|
$oGeocode = new Nominatim\Geocode($oDB);
|
||||||
|
|
||||||
$oGeocode->setLanguagePreference($oParams->getPreferredLanguages(false));
|
$oGeocode->setLanguagePreference($oParams->getPreferredLanguages(false));
|
||||||
$oGeocode->setReverseInPlan(true);
|
|
||||||
$oGeocode->loadParamArray($oParams);
|
$oGeocode->loadParamArray($oParams);
|
||||||
|
|
||||||
if ($oParams->getBool('search')) {
|
if ($oParams->getBool('search')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user