I need to sort my search results by product categories.
If I have Product A and Product B in Category A And I have Product C and Product D in Category B
If all products are available in search result, I want to show them like,
Product A, Product B, Product C, Product D
I want to put same category products with each other on results page.
Currently It is showing as
Product A, Product C, Product B, Product D
I have tried this but its not working.