[-] FO : fixed chinese search with multiple symbols #PSCFV-10322

This commit is contained in:
Damien Metzger committed 2013-09-09 11:19:11 +02:00
1 parent e1d0347757
commit dcad699ede
1 file changed
+3 -6
+3 -6
View File
@@ -140,8 +140,6 @@ class SearchCore
$string = implode(' ', $processed_words); $string = implode(' ', $processed_words);
} }
if ($indexation)
{
// If the language is constituted with symbol and there is no "words", then split every chars // If the language is constituted with symbol and there is no "words", then split every chars
if (in_array($iso_code, array('zh', 'tw', 'ja')) && function_exists('mb_strlen')) if (in_array($iso_code, array('zh', 'tw', 'ja')) && function_exists('mb_strlen'))
{ {
@@ -159,7 +157,7 @@ class SearchCore
$string = $letters.$symbols; $string = $letters.$symbols;
} }
else elseif ($indexation)
{ {
$minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN'); $minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN');
if ($minWordLen > 1) if ($minWordLen > 1)
@@ -171,7 +169,6 @@ class SearchCore
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string); $string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
} }
} }
}
$string = trim(preg_replace('/\s+/', ' ', $string)); $string = trim(preg_replace('/\s+/', ' ', $string));
return $string; return $string;
@@ -374,13 +371,13 @@ class SearchCore
$attributes = ''; $attributes = '';
$attributesArray = $db->executeS(' $attributesArray = $db->executeS('
SELECT al.name, pa.ean13, pa.reference, pa.upc FROM '._DB_PREFIX_.'product_attribute pa SELECT al.name FROM '._DB_PREFIX_.'product_attribute pa
INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute
INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.') INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.')
'.Shop::addSqlAssociation('product_attribute', 'pa').' '.Shop::addSqlAssociation('product_attribute', 'pa').'
WHERE pa.id_product = '.(int)$id_product); WHERE pa.id_product = '.(int)$id_product);
foreach ($attributesArray as $attribute) foreach ($attributesArray as $attribute)
$attributes .= $attribute['name'].' '.$attribute['ean13'].' '.$attribute['reference'].' '.$attribute['upc'].' '; $attributes .= $attribute['name'].' ';
return $attributes; return $attributes;
} }