From aa0651d5f0f0e88fb2806b885dbff1bf3fe7ed12 Mon Sep 17 00:00:00 2001 From: gBrunier Date: Tue, 26 Apr 2011 09:14:15 +0000 Subject: [PATCH] [-] FO : Fixed bug #PSCFI-1582 - Not correct search. Now we list all products which contains the search word. --- classes/Search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Search.php b/classes/Search.php index da9431b95..efd2021c5 100644 --- a/classes/Search.php +++ b/classes/Search.php @@ -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]);