[-] FO : Fixed bug #PSCFI-1582 - Not correct search. Now we list all products which contains the search word.
This commit is contained in:
+2
-2
@@ -172,10 +172,10 @@ class SearchCore
|
||||
FROM '._DB_PREFIX_.'search_word sw
|
||||
LEFT JOIN '._DB_PREFIX_.'search_index si ON sw.id_word = si.id_word
|
||||
WHERE sw.id_lang = '.(int)$id_lang.'
|
||||
AND sw.word LIKE '.($word[0] == '-' ? ' \''.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\''.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'').'
|
||||
AND sw.word LIKE '.($word[0] == '-' ? ' \'%'.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\'%'.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'').'
|
||||
) ';
|
||||
if ($word[0] != '-')
|
||||
$scoreArray[] = 'sw.word LIKE \''.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'';
|
||||
$scoreArray[] = 'sw.word LIKE \'%'.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'';
|
||||
}
|
||||
else
|
||||
unset($words[$key]);
|
||||
|
||||
Reference in New Issue
Block a user