Tag Archives: magento search batter result

How to search for all words in magento?

If u want to make an AND search instead of OR, you will need to rewrite the class


at this location in magento v1.7.0.2.


Now Go to the following function in this file

public function prepareResult($object, $queryText, $query)

You have to change the following line

$likeCond = '(' . join(' OR ', $like) . ')';


$likeCond = '(' . join(' AND ', $like) . ')';

Now change the Search Type to “LIKE” from catalog search section in admin.

Now reindex the search index afterwards to have an effect..

1 Comment

Posted by on Sep 26, 2013 in Magento, Mysql, PHP


Tags: , , , , , , , , , , ,

%d bloggers like this: