]> git.openstreetmap.org Git - nominatim.git/commitdiff
make search with reverse plan default
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 11 Aug 2015 20:30:07 +0000 (22:30 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 11 Aug 2015 20:30:07 +0000 (22:30 +0200)
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
website/search.php

index 48ff7c4ea7ba8204abbb3bdbd1d684eb81a31582..cc81e7a90967f1b6c73a084bdab7b15c85439324 100644 (file)
@@ -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); 
 
index b18c391ea2f62aaa470371358a1547f5e6b0cb43..a0f12bddb74f326d926bb91a98cc3b3983da7fd9 100755 (executable)
        $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';