0

I am using Magento 1.7.0.2, i have some issues with the search results.

I searched for keyword table skirt its returning results, but when i search for tableskirt its not returning result.

I have changed the following code in app/code/core/Mage/catalogsearch/model/Resource/Fulltext.php file

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

to

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

But no change happens with results.Anybody knows how to fix the issue.Please Suggest!

1

It won't. The LIKE search requires an exact match, so unless you parse the query string and split it into separate words used to be used as the LIKE search input, it will result in no match.

LIKE search is dumb and does exactly what its input says.

You need a smarter search like LUCENE or SOLR.

0

I Finally got the solution, Please see the below steps,

I have used one condition to check whether the $queryText is having space in it.If it has space then i have used the default query else i have used the following code,

foreach ($words as $word)
  {
      $like[] = 'replace(`s`.`data_index`," ","") LIKE :likew' . $likeI;
      $bind[':likew' . $likeI] = '%' . rtrim($word, 's') . '%';
      $likeI++;
  }                     

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy