From 4bc40d2c0bc591e7738fc762e74c18e11d1922a1 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Thu, 24 Jan 2013 18:25:59 +0000 Subject: [PATCH 1/1] for structured queries assume 2 char country param values are a iso country code --- website/search.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/search.php b/website/search.php index 80a05a64..3e8e5b79 100755 --- a/website/search.php +++ b/website/search.php @@ -416,6 +416,13 @@ $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; -- 2.39.5