]> git.openstreetmap.org Git - nominatim.git/commitdiff
for structured queries assume 2 char country param values are a iso country code
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Thu, 24 Jan 2013 18:25:59 +0000 (18:25 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Wed, 30 Jan 2013 13:40:04 +0000 (13:40 +0000)
website/search.php

index 80a05a6442c142a1fcc969c34d046c6d60d9bf70..3e8e5b7954742728400b0f6a5eee65cda2148646 100755 (executable)
                        $aWordFrequencyScores = array();
                        foreach($aDatabaseWords as $aToken)
                        {
+                               // Very special case - require 2 letter country param to match the country code found
+                               if ($bStructuredPhrases && $aToken['country_code'] && !empty($aStructuredQuery['country']) 
+                                  && strlen($aStructuredQuery['country']) == 2 && strtolower($aStructuredQuery['country']) != $aToken['country_code'])
+                               {
+                                       continue;
+                               }
+
                                if (isset($aValidTokens[$aToken['word_token']]))
                                {
                                        $aValidTokens[$aToken['word_token']][] = $aToken;