From c9d7015f696b3083dd38db94cb0df864e9d66def Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Tue, 11 Aug 2015 22:30:07 +0200 Subject: [PATCH 1/1] make search with reverse plan default The old behaviour with reverse planning for only selected languages can be reinstated by setting CONST_Search_ReversePlanForAll to false. Fixes #293 --- settings/settings.php | 3 +++ website/search.php | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/settings/settings.php b/settings/settings.php index 48ff7c4e..cc81e7a9 100644 --- a/settings/settings.php +++ b/settings/settings.php @@ -99,6 +99,9 @@ @define('CONST_Search_TryDroppedAddressTerms', false); @define('CONST_Search_NameOnlySearchFrequencyThreshold', 500); + // If set to true, then reverse order of queries will be tried by default. + // When set to false only selected languages alloow reverse search. + @define('CONST_Search_ReversePlanForAll', true); @define('CONST_Places_Max_ID_count', 50); diff --git a/website/search.php b/website/search.php index b18c391e..a0f12bdd 100755 --- a/website/search.php +++ b/website/search.php @@ -20,10 +20,14 @@ $aLangPrefOrder = getPreferredLanguages(); $oGeocode->setLanguagePreference($aLangPrefOrder); - if (isset($aLangPrefOrder['name:de'])) $oGeocode->setReverseInPlan(true); - if (isset($aLangPrefOrder['name:ru'])) $oGeocode->setReverseInPlan(true); - if (isset($aLangPrefOrder['name:ja'])) $oGeocode->setReverseInPlan(true); - if (isset($aLangPrefOrder['name:pl'])) $oGeocode->setReverseInPlan(true); + if (CONST_Search_ReversePlanForAll + || isset($aLangPrefOrder['name:de']) + || isset($aLangPrefOrder['name:ru']) + || isset($aLangPrefOrder['name:ja']) + || isset($aLangPrefOrder['name:pl'])) + { + $oGeocode->setReverseInPlan(true); + } // Format for output $sOutputFormat = 'html'; -- 2.39.5