RSS

Tag Archives: magento search

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

Mage_CatalogSearch_Model_Resource_Fulltext

at this location in magento v1.7.0.2.

app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php

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) . ')';

To

$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: