mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-08 02:54:08 +00:00
remove code for dropping address terms
This code has been inactive in quite a while and is a suboptimal solution. We need to be much more selective in what gets dropped.
This commit is contained in:
@@ -1229,35 +1229,6 @@ class Geocode
|
|||||||
ksort($aGroupedSearches);
|
ksort($aGroupedSearches);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CONST_Search_TryDroppedAddressTerms && sizeof($this->aStructuredQuery) > 0) {
|
|
||||||
$aCopyGroupedSearches = $aGroupedSearches;
|
|
||||||
foreach ($aCopyGroupedSearches as $iGroup => $aSearches) {
|
|
||||||
foreach ($aSearches as $iSearch => $aSearch) {
|
|
||||||
$aReductionsList = array($aSearch['aAddress']);
|
|
||||||
$iSearchRank = $aSearch['iSearchRank'];
|
|
||||||
while (sizeof($aReductionsList) > 0) {
|
|
||||||
$iSearchRank += 5;
|
|
||||||
if ($iSearchRank > iMaxRank) break 3;
|
|
||||||
$aNewReductionsList = array();
|
|
||||||
foreach ($aReductionsList as $aReductionsWordList) {
|
|
||||||
for ($iReductionWord = 0; $iReductionWord < sizeof($aReductionsWordList); $iReductionWord++) {
|
|
||||||
$aReductionsWordListResult = array_merge(array_slice($aReductionsWordList, 0, $iReductionWord), array_slice($aReductionsWordList, $iReductionWord+1));
|
|
||||||
$aReverseSearch = $aSearch;
|
|
||||||
$aSearch['aAddress'] = $aReductionsWordListResult;
|
|
||||||
$aSearch['iSearchRank'] = $iSearchRank;
|
|
||||||
$aGroupedSearches[$iSearchRank][] = $aReverseSearch;
|
|
||||||
if (sizeof($aReductionsWordListResult) > 0) {
|
|
||||||
$aNewReductionsList[] = $aReductionsWordListResult;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$aReductionsList = $aNewReductionsList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ksort($aGroupedSearches);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter out duplicate searches
|
// Filter out duplicate searches
|
||||||
$aSearchHash = array();
|
$aSearchHash = array();
|
||||||
foreach ($aGroupedSearches as $iGroup => $aSearches) {
|
foreach ($aGroupedSearches as $iGroup => $aSearches) {
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ if (isset($_GET['debug']) && $_GET['debug']) @define('CONST_Debug', true);
|
|||||||
|
|
||||||
@define('CONST_Search_BatchMode', false);
|
@define('CONST_Search_BatchMode', false);
|
||||||
|
|
||||||
@define('CONST_Search_TryDroppedAddressTerms', false);
|
|
||||||
@define('CONST_Search_NameOnlySearchFrequencyThreshold', 500);
|
@define('CONST_Search_NameOnlySearchFrequencyThreshold', 500);
|
||||||
// If set to true, then reverse order of queries will be tried by default.
|
// If set to true, then reverse order of queries will be tried by default.
|
||||||
// When set to false only selected languages alloow reverse search.
|
// When set to false only selected languages alloow reverse search.
|
||||||
|
|||||||
Reference in New Issue
Block a user