0
votes

I am having some trouble with Magento admin product search! Basically I need the following:

If a product name is "Microsoft Wireless Mouse and Keyboard" and a user types into the admin manage products screen "wireless keyboard" then I want that product to appear. At the moment, unless I type two words, exactly in the order they appear (e.g "wireless mouse"), I do not get the search results.

I have tried setting Magento Catalog settings to Like, Fulltext and Combine, and all result in the exact same results. I have cleared Cache and Reindexed after changing each result, and they have not effect on how the search works.

I am running Magento 1.9.2 and running the VES Superstore theme.

Any advice on which file I can override and change the MySql query in to do what I need?

Thanks

2

2 Answers

0
votes

Under /app/code/core/Mage/Adminhtml/etc/config.xml you will find the defined models for the global admin search.

If you go through the controller /app/code/core/Mage/Adminhtml/controllers/IndexController.php method globalSearchAction, you will find that Magento reads the configuration and loops on them applying the search on each module and then merging the whole result.

Since you are looking for specifically where the products are being searched, it is located in /app/code/core/Mage/Adminhtml/Model/Search/Catalog.php

And the query is as follows:

$collection = Mage::helper('catalogsearch')->getQuery()->getSearchCollection()
    ->addAttributeToSelect('name')
    ->addAttributeToSelect('description')
    ->addSearchFilter($this->getQuery())
    ->setCurPage($this->getStart())
    ->setPageSize($this->getLimit())
    ->load();
0
votes

This answered my question for me:

http://www.bigeyedeers.co.uk/better-catalog-product-search-magento/

I didn't really understand the previous answer, thank you for your help though.