for structured queries assume 2 char country param values are a iso country code

This commit is contained in:
Brian Quinion 2013-01-24 18:25:59 +00:00
parent fb76671ab9
commit 4bc40d2c0b

View File

@ -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;