Improve search result function magento

Home / Magento / Improve search result function magento

Magento default seek capacity is really exceptional, yet in the event that you need to enhance with additional clear and relevant effect then need to taking after progressions.

Magento will sort on a rising request. In different statements, the most applicable items will be at the base. We need plunging request, in different statements, the best comes about at the top. We are set to change it by pointing out the diving sort request in the template record. Search for the document, and in the event that its not in your topic’s template/catalogsearch envelope, include it.

<input type="hidden" name="order" value="relevance" />
<input type="hidden" name="dir" value="desc" />

This changes the search so that our most relevant results show first.

Make a copy of app/code/core/Mage/CatalogSearch/Model/resource/Fulltext.php

And place it here app/code/local/Mage/CatalogSearch/Model/resource/Fulltext.php

On line 356 is the following code

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

Change it to the following

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

Then on line 378 find

$where .= ($where ? ' OR ' : '') . $likeCond;

And change it to

$where .= ($where ? ' AND ' : '') . $likeCond;

How this post is helpful to you and now your search results should be much more relevant!

Related Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *