1

I got index.php/catalogsearch/result/?cat=&q=Vitamin+E

I want to remove unrelated results,I want to just contain product name only "Vitamin E" this string may be url as index.php/catalogsearch/result/?cat=&q=Vitamin&E

I configure search from admin panel as below:

  1. Set No All Catalog==>Attributes==>Manage Attributes except name

  2. Set System==>Config==>Catalog ==>Catalog Search==> Search Type==>Fulltext

  3. App/Code/Core/Mage/CatalogSearch/Model/Resource/fulltext.php Replace all OR to AND

Line:about 354

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

    Change to 


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

Line:about 378

if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE) {
        $where .= ($where ? ' OR ' : '') . $likeCond;
}

Changed to

if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE) {
        $where .= ($where ? ' AND' : '') . $likeCond;
}

[Details as As https://mirasvit.com/qa/magento-search.html]

Still Got Unrelated Results!!

Your Answer

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

Browse other questions tagged or ask your own question.