-1

Hi all I am Searching one product in search box but magneto will display Searching product as well as some other product. How to over come this issue??

Magento 2
  • 143
  • 2
  • 9

2 Answers2

3

You can change search options in the backend:

System -> Configuration -> Catalog -> Catalog Search

You can choose search type as 'Like', 'Fulltext' and 'Combine', which are explained in more detail here.

Community
  • 1
  • 1
Gerard de Visser
  • 7,590
  • 9
  • 50
  • 58
1

GO to the admin section System -> Configuration -> Catalog -> Catalog Search. Select fulltext and save.

Then open file app/code/core/Mage/CatalogSearch/Model/resources/Fulltext.php

and make changes in the code as follows:

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

&

$where .= ($where ? ' OR ' : '') . $likeCond;
to
$where .= ($where ? ' AND ' : '') . $likeCond; 
Abhinav Kumar Singh
  • 2,325
  • 1
  • 10
  • 11