From f8501558fc8178a2715034c23dbfb98ccf77fed2 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. git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@6066 b9a71923-0436-4b27-9f14-aed3839534dd --- 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]);