From: Brian Quinion Date: Fri, 13 Sep 2013 13:24:16 +0000 (+0100) Subject: Limit wordset combination explosion to 120 variants (1x2x3x4x5) X-Git-Tag: v2.2.0~27 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/44262c1d4c2c719394eaca6b1717e90d9c13b195 Limit wordset combination explosion to 120 variants (1x2x3x4x5) --- diff --git a/lib/Geocode.php b/lib/Geocode.php index 4b5b4e3d..3e5c7be1 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -631,8 +631,11 @@ if ($bStructuredPhrases) $sPhraseType = $aPhraseTypes[$iPhrase]; else $sPhraseType = ''; - foreach($aPhrases[$iPhrase]['wordsets'] as $aWordset) + foreach($aPhrases[$iPhrase]['wordsets'] as $iWordSet => $aWordset) { + // Too many permutations - too expensive + if ($iWordSet > 120) break; + $aWordsetSearches = $aSearches; // Add all words from this wordset