Magento search not returning expected results


goto below path

app\code\core\Mage\CatalogSearch\Block\

and then open Result.php file

now search this method setListCollection().

it look like

public function setListCollection()
{
//        $this->getListBlock()
//           ->setCollection($this->_getProductCollection());
return $this;
}

replace below code

public function setListCollection()
{
$this->getListBlock()
->setCollection($this->_getProductCollection());
return $this;
}

in short you need to uncomment some code so do it.

and then goto front side it will be work fine

if it will be work fine, don’t do below steps.

==================

If search still not working, check below steps.

goto below path

app\code\core\Mage\CatalogSearch\Model\Resource\

and then open Fulltext.php file.

goto 357  to 360 line

and check
if($like) {
$likeCond = ‘(‘ . join(‘ OR ‘, $like) . ‘)’;
}
loop

now change into
if($like) {
$likeCond = ‘(‘ . join(‘ AND ‘, $like) . ‘)’;
}

Note: I have tested in 1.6 version of magento

setListCollection()

About these ads

One thought on “Magento search not returning expected results

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s