From 44262c1d4c2c719394eaca6b1717e90d9c13b195 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Fri, 13 Sep 2013 14:24:16 +0100 Subject: [PATCH] Limit wordset combination explosion to 120 variants (1x2x3x4x5) --- lib/Geocode.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.5