How to show the Exact searh result in Magento

0
40
views
Advertisement

Hello

If you want to show the exact search reuslt for your products
Two things need to be changed

1) In admin system->configuration->catalog->catlogsearch->Search Type
Make it as Like

2)Just copy the fulltext.php file in local folder as given
app/code/local/Mage/CatalogSearch/Model/Resource/Fulltext.php

and just replace the above code

foreach ($words as $word) {
$like[] = $helper->getCILike(‘s.data_index’, $word, array(‘position’ => ‘any’));
}
if ($like) {
$likeCond = ‘(‘ . join(‘ OR ‘, $like) . ‘)’;
}

BY

foreach ($words as $word) {
$like[] = ‘`s`.`data_index` LIKE :likew’ . $likeI;
$bind[‘:likew’] = ‘%’ . $queryText . ‘%’;
}
if ($like) {
$likeCond = ‘(‘ . join(‘ AND ‘, $like) . ‘)’;
}

and clear the cache and reindex the data from admin

Regards
Sandeep