]> git.openstreetmap.org Git - nominatim.git/commitdiff
Limit wordset combination explosion to 120 variants (1x2x3x4x5)
authorBrian Quinion <brian.quinion@mapquest.com>
Fri, 13 Sep 2013 13:24:16 +0000 (14:24 +0100)
committerBrian Quinion <brian.quinion@mapquest.com>
Fri, 13 Sep 2013 13:24:16 +0000 (14:24 +0100)
lib/Geocode.php

index 4b5b4e3d8be3007a72cd497b7a0deb92e4aa1dd0..3e5c7be1f2a72c2ba3988984e49cadb4fdad9b44 100644 (file)
                                                if ($bStructuredPhrases) $sPhraseType = $aPhraseTypes[$iPhrase];
                                                else $sPhraseType = '';
 
                                                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
                                                        $aWordsetSearches = $aSearches;
 
                                                        // Add all words from this wordset