I want to sort the search result collection by product attribute option value.
Scenario:
I have created a custom attribute called "product_category" as a drop down attribute.
Which has the following options,
1.Unit.
2.Component
3.Bundle
So once We search any product I need to load the product created with "Unit" option on top for the particular search keyword which means option with Unit should load first and the rest.
Example:
3 products are created with below information.
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 implemented? Thanks in advance!!!