To boost more popular or best-selling items, use a ranking signal based on your own business data.
A common approach is to add a numeric attribute to each record that reflects popularity, such as sales volume, conversions, or another score that matters for your store. You can then use that attribute in customRanking so that, when results have similar textual relevance, the more popular items are ranked higher.
If you want to promote a specific group of products without changing your overall ranking strategy, you can also use a boolean or categorical attribute together with optionalFilters. For example, you might add an attribute such as isPopular:true to selected records and boost those at query time.
When using optionalFilters, the attribute must be configured in attributesForFaceting before it can be used.
In general:
Use
customRankingwhen you want popularity or sales data to be part of your ongoing ranking strategy.Use
optionalFilterswhen you want to promote a defined set of records more selectively at query time.