Magento – Filter Search Results using Attribute and Category

catalogsearchproduct-attribute

I have a custom requirement where I need to change the catalog search results.

What I need to do is to show the products based on attribute as well as category

For example if you search attribute pink, it will list down all the products on search page having the attribute pink assigned to them

Similarly, if a product is only assigned to category X and when you search X, it will list down all the products with category X assigned.

Do I need to change the Catalogsearch Model ?

How can I achieve this ?

Please Help.

Thanks.

Best Answer

If you simply want an attribute to be searchable then you can set the flag is_searchable on this attribute, either via the admin section or via a set-up script.

As for the categories as far as I am aware Magento will not do this by default, so you will need to create a module for this.