Appearance
Sorting a product collection
Looking for setup prerequisites, authentication details, and package references? Start with the Java SDK landing page.
When using your own search engine and you want to get a personalized sorting of a collection of Products, you can use SortProducts.
Before going any further, read about handling different types of users here.
java
Recommender recommender = new Recommender(
"00000000-0000-0000-0000-000000000001",
"your API Key",
"the server URL for the dataset");
String[] productIds = new String[] { "p-1", "p-2", "p-3" };
SortProductsRequest request = SortProductsRequest.create(
Language.create("da"),
Currency.create("DKK"),
"Product Listing Page",
getUser())
.setProductIds(productIds);
ProductRecommendationResponse response = recommender.recommend(request);The recommended way of using Relewise for category pages is using our search features. Read about how to use our Search API for category pages here.