How product grouping works

The Solr product grouping feature enables grouping parent catalog entries with their underlying SKUs at query time. Products can be chosen to represent the group that is returned in search results to provide visual relevancy.

A common index field is indexed between a product and their underlying SKUs, which is used later as the grouping field. When querying the search index, grouping parameters are appended to the Solr query. As a result, the search response is structured in groups, instead of a list of Solr documents. Each group contains a list of related Solr documents. The number of rows and pagination is applied to the number of groups, instead of to the number of returned Solr documents. The following terminology is used for product grouping:


Group result selection process

The following diagram demonstrates the sample search group response and group owner selection process:

Where:

Facet counts can be configured to either be based on the original Solr documents, or based on the number of groups.


Grouping processors and search profiles

The SearchRelevancyByProductGroupingQueryPreprocessor is used to read the grouping parameters from a search profile, and add them to the search query. It is enabled when the relevancyType value is set to 2.

The SearchRelevancyByProductGroupingPostprocessor is added as the first postprocessor to handle the search group response. The postprocessor selects only one Solr document from each group and creates a flat Solr document list to be consumed by other postprocessors. Then, the result is returned in the final REST response. It is enabled when the relevancyType value is set to 2.

The IBM_findProductsBySearchTerm, IBM_findProductsByNameAndShortDescriptionOnly, IBM_findProductsByNameOnly, and IBM_findProductsByUnstructureOnly search profiles can be used by the productView bySearchTermServices REST service.

The IBM_findProductsByCategory and ComposeFacetListByCategoryId search profiles can be used by the productView byCategoryId REST service. The following snippet is a sample group configuration as defined in a search profile:

Where:

We can add more grouping parameters using the same group.parameter_name convention. For more information about grouping parameters, see Result Grouping / Field Collapsing.


Group representatives

There is a group representative for each product grouping. Instead of returning the group owner, one of the SKUs or some of its properties can be returned instead, along with the group owner. Or, instead of ignoring the other group members, the price range can be found based on the group members.

The following diagram demonstrates the representative product selection process:

Where:

The following snippet is a sample representative product configuration as defined in a search profile:

Where:


Related tasks
Enable product grouping