Search Profile Context

The categories you browse through are organized in a hierarchical order and create a specific search context.

It may however happen that one category has more than one parent category, which results in having two different category paths. Before you move to the examples, let's differentiate between a category path and a category merging path. The category path lists all the parents of a selected category and usually so does the category merging path. However, if a category has more than one parent (like the one above) the merging path takes them all into consideration, creating a longer path.

You can see both paths at the top of the adaptive search perspective:

The Search profile context lists all the categories to be merged whereas search in category shows the path of the category you are currently browsing. To get to know how the system comes up with a search profile context path, have a look at the examples below:

As you can notice, category paths for the Sunglasses category differ when it comes to the parent categories.
  • Start of the navigation pathGlobal Next navigation step Collections Next navigation step SunglassesEnd of the navigation path
  • Start of the navigation pathGlobal Next navigation step Categories Next navigation step Clothes Next navigation step SunglassesEnd of the navigation path
Knowing the parent categories of a selected category is essential to know which categories are to be merged to produce the overall result on the storefront. The interface is used to define the category merging path.
/**
 * Implementations of this interface should build the category path.
 */
@FunctionalInterface
public interface
{
    /**
     * Returns the category path.
     *
     * @param searchQuery
     *           - the search query
     * @param catalogVersions
     *           - the catalog versions
     *
     * @return the category path
     */
    List<CategoryModel> resolveCategoryPath(SearchQuery searchQuery, List<CatalogVersionModel> catalogVersions);
}
The default implementation of the interface collects all the parent category configurations set for a specific catalog version and returns the category path in a form of a flat list, so that all the parent configurations are included. The diagram below shows you that there can be two possible category merging paths:
  • Path 1: Start of the navigation pathGlobal Next navigation step Collections Next navigation step Categories Next navigation step Clothes Next navigation step SuglassesEnd of the navigation path
  • Path 2:Start of the navigation pathGlobal Next navigation step Categories Next navigation step Clothes Next navigation step SunglassesEnd of the navigation path

At this moment, the merging path is chosen by the system. To avoid confusion, the search profile configuration for a specific category is at this point always the same even if it has more than one parent. For example for Sunglasses the merging path is always Start of the navigation pathGlobal Next navigation step Collections Next navigation step Categories Next navigation step Clothes Next navigation step SunglassesEnd of the navigation path no matter, which category path is selected by the user in the Categories area.