git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8179 b9a71923-0436-4b27-9f14-aed3839534dd

This commit is contained in:
rMalie
2011-08-24 15:57:10 +00:00
parent 89fcb38dc7
commit b12bf222a9
20 changed files with 58 additions and 20 deletions
+8
View File
@@ -461,13 +461,21 @@ class SearchCore
$wordIdsByWord[$product['id_shop']][$product['id_lang']]['_'.$word] = 0;
}
$existingWords = $db->ExecuteS('SELECT word FROM '._DB_PREFIX_.'search_word WHERE word IN ('.implode(',', $queryArray2).') GROUP BY word');
if($existingWords)
foreach($existingWords as $data)
unset($queryArray[$data['word']]);
if (count($queryArray))
{
// The words are inserted...
$db->Execute('
INSERT IGNORE INTO '._DB_PREFIX_.'search_word (id_lang, id_shop, word)
VALUES '.implode(',',$queryArray));
}
if (count($queryArray2))
{
// ...then their IDs are retrieved and added to the cache
$addedWords = $db->ExecuteS('
SELECT sw.id_word, sw.word