How best to rank results

I am trying to build something similar to

There is a default ranking order but by clicking each of the options along the top bar the results are ranked in a different order.

So I need to have a default ranking, but then apply further ranking factors on top of that depending on what was clicked.

Each product will become a record in the index, and the attached attributes will be the product features and scores. Those product features and score is what will be used as the options along the top of the search bar.

To implement this will I have to create hundreds of replica indexes for every possible combination?

Or would each option along the top act as a filter that effects the ranking order somehow?

Or perhaps there is another way?

Any advice would be much appreciated.


You don’t need to create a replica for each combination, what you are trying to achieve is called “filtering” and “faceting”. You can learn more about those notions in the docs:

This will allow you to remove some products from the result list, if there are out of a price range or of a different color than the selected colors, for instance.

Replicas are used to setup different sorting:

Let us if this helped you and if you have further questions!

Thanks that gives me a good start :slight_smile: