---
title: "Document grouping"
slug: "document-grouping"
abstract: "Group or ungroup item variations at the domain and widget levels."
---
# Document grouping

Document grouping enables marketers to customize how search results are organized and presented. You can choose whether to display all variations of an item (such as a product entity) as individual search results, or as a single grouped result based on a specific attribute.

Grouped results can make it easier for users to find what they are looking for without being overwhelmed by variations, while ungrouped results can be useful for clearance or discount pages where users might want to see all available variations of a document (item).

You enable grouping per entity on the domain level. This means that you can enable grouping for your *product* and *content* entities, or for just one entity type.

You group an entity by one specific attribute. For example, you can enable grouping for the product entity's style ID attribute. If there are nine variations of a sneaker, each one will have the same style ID. With grouping enabled, the user will get a single search result for the sneaker instead of nine.

In some cases you might want to enable grouping for *content* entities. You could do this, for example, to group results for an insurance document that has multiple variants, one for each state it applies to.

## Enable an attribute for grouping by entity

You enable grouping on an entity by selecting the attribute you want to group by. You can select *one* attribute per entity. This enables grouping for all search widgets within that entity. You can disable grouping on search widgets.

> [!important]
> When a grouping attribute has been set for an entity and you publish, you cannot remove or change the grouping attribute.

To enable grouping for an entity:

1. On the menu bar, click **Administration** > **Domain Settings**.
2. On the **General Settings** tab, click **Document Display Settings**.
3. In the **Document Grouping** section, click **Edit**.
4. On the **Document Display Settings** page, locate the entity you want to enable grouping for, then in the **Grouping attribute** drop-down list, click the attribute you want to use to group the entity.
5. Click **Save**.

![Screenshot of the Document Grouping settings.](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/ProductGrouping.png)

When an attribute is enabled for grouping, [a checkmark is displayed](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/attributes.html#UUID-72145f1b-9674-0d26-7dd8-2728cbec099e_section-idm4549409668523233410437655714 "Scope") on the **Domain Settings** > **Attributes** page, in the **Grouping** column.

## Edit grouping settings on a widget

When grouping is enabled for an entity, new widgets are by default enabled for grouping. However, you can override this setting at the widget level for specific search experiences.

For example, for a clearance or discount page, you might want your [search results widget](urn:resource:component:1577165/section-idm4589942276851233673031875772) to show a separate search result for every size and color that's available. In that case, you'd disable grouping for the product entity on the search results widget.

To edit grouping settings on a widget:

1. On the menu bar, click **Widgets**.
2. On the list of widgets, click the name of the widget you want to edit.
3. Click **Widget Settings** > **General** > **Edit**.
4. Do one of the following:
    - To enable or disable grouping settings for all entities, use the switch at the top of the **Grouping** section.
    - To edit grouping settings for an individual entity, use the switch in the **Used for grouping** column.
5. Click **Save**.

When grouping is enabled for a widget, the slot view of a [widget rule](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/variations-and-rules.html "Variations and rules") will show a grouping badge on items that are grouped.

![Ungrouped and grouped products displayed in the slot view of a widget rule.](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/GroupedProduct_UserExperience.png)

This helps the business user see how search results will be displayed to their customers.

## Group or ungroup items in the content collection

By default, the entity browser within the content collection shows all items in a given group as a single search result, and ungrouped items as individual results. If you prefer, you can change the setting so that all items, whether they are in a group or not, are shown individually.

A grouped item has a grouping badge next to its name. For example, *Grouped product* in the product browser.

To group or ungroup items in the content collection (in this example *products*):

1. On the menu bar, click **Content Collection** > **Products**.
2. On the **Product Browser** tab, use the **Group Items** switch to select the desired setting.

### View all variations of a grouped content entity

You can find information on all the variations of a grouped entity within the content collection. The entity **Variation Details** page provides a comprehensive view of the available variations and their attributes.

To view all variations of a grouped content entity (in this example, a *product*):

1. On the menu bar, click **Content Collection** > **Products**.
2. On the **Product Browser** tab, click the name of a product that has the *Grouped product* badge.
3. On the product page, click the **Variations** tab.

The **Variation Details** overview shows the name, style, and attributes of each variation.