Tuning product grouping
The product grouping feature is based on the Solr field collapsing and result grouping query feature. There might be performance impacts when you enable product grouping. Consider the factors that influence performance impacts and how to design and tune to minimize the impact. It is recommended that you assess the business requirements for the affected store pages, as some of the configurations might change the search results being returned.
When product grouping is enabled, and to return the most relevant visual content and accurate facet values, the search scope is increased to use the ALL search type for catalog entries, including SKUs. Although the final search result displayed in the storefront filters out SKUs, some of the preceding processes are still run on the entire result set, which includes SKUs.
The performance impact is typically caused by working with large result sets, caused by increasing the search scope to include SKUs. The following list describes the different factors that contribute to the extra performance impact when you work with larger result sets. Alternative options are presented that can help improve product grouping performance.
Procedure
-
Product level facet count and Item level facet count:
-
Using the default sequencing function on category pages:
- The default sequencing function applies a sorting logic on a multivalued field. A sequencing function is created to do so, as Solr does not support sorting on multivalued fields. The larger the result set, the more expensive the sorting operation becomes.
- Alternatively, consider disabling the sequencing provider com.ibm.commerce.search.internal.expression.provider.SearchProductSequencingExpressionProvider, and apply sorting on a single value field. For more information, see Disabling search expression providers and result filters in the search configuration file (wc-search.xml).
-
Set the
UseValueSourceFunctionForSortingsearch
configuration tofalse
in the Search EAR wc-component.xml file. This configuration will allow you to use the Solr native sort function instead of the default sort function in order to provide better performance. For more information, see Search properties in the component configuration file (wc-component.xml).
-
Expanded category navigation on top category pages.
- In extreme cases you may find combinations of large result sets. This can occur when a product has a large number of SKUs, a large page size, and many facets returned by the search query. If such cases occur, consider making two search requests. One will populate the facet widget, and the other will populate the product search result set. Each of the search requests can be optimized. Optimizing the facet search request would require that group facet be set to true, and row count set to 0. The product search request can be optimized by setting group facet to false.