I want to sort the search result collection by product attribute value.
Scenario:
I have created a custom attribute called "product_category" as a drop down attribute.
Which has the below options,
1.Unit.
2.Component
3.Bundle
So once we search any product i need to load the product created with "Unit" option first for the particular keyword match.
Example:
3 products are created with below data.
Unit Test product - product_category attribute value is set as "Unit".
Test bundle product - product_category attribute value is set as "Bundle".
Test component product - product_category attribute value is set as "Component".
So whenever i searched the keyword, "Test Product" I need to load the product where product_category attribute value is set as "Unit" on top in search result page.
Can anyone help me how this can be achieved? Thanks in advance!!