Skip to content

Product Category Search with our Java client

Looking for setup prerequisites, authentication details, and package references? Start with the Java SDK landing page.

Start by making a Searcher instance.

java
Searcher searcher = new Searcher(
    "00000000-0000-0000-0000-000000000001",
    "your API Key",
    "the server URL for the dataset");

Before going any further, read about handling different types of users here.

The following example performs a Product Category search and returns display names for the matching categories.

java
ProductCategorySearchRequest request = ProductCategorySearchRequest.create(
    Language.create("da"),
    Currency.create("DKK"),
    getUser(),
    "Search Page",
    "shoe",
    0,
    10);

request.setSettings(
    ProductCategorySearchSettings.create()
        .setSelectedCategoryProperties(
            SelectedProductCategoryPropertiesSettings.create()
                .setDisplayName(true)
                .setPaths(true)
        )
);

ProductCategorySearchResponse response = searcher.search(request);

Don't know us? Don't worry - you can find more information about us, by visiting our main page www.relewise.com