> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Product Grouping

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/5/fusion/getting-data-out/curating-your-search-experience/predictive-merchandiser/product-grouping

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/getting-data-out/curating-your-search-experience/predictive-merchandiser/product-grouping

[old doc.lw link]: https://doc.lucidworks.com/fusion/5.9/596

Predictive Merchandiser makes it easy to group products together so they can be presented to the user. This can be useful when you want to show a product in all of its color variants or the various versions of a product (basic or advanced, for example).

<img src="https://mintcdn.com/lucidworks/xQr7Fxxc7lI5hKz-/assets/images/predictive-merchandiser/product-grouping-example01.png?fit=max&auto=format&n=xQr7Fxxc7lI5hKz-&q=85&s=36c8f21ba366d0e40025c5f5be3f5e90" alt="Product Groups" width="603" height="859" data-path="assets/images/predictive-merchandiser/product-grouping-example01.png" />

Product groups can be boosted or blocked. If you want to promote a product group that is on sale, for example, you can boost the group to the top of the results.

You can still apply rules individually to products within a group. This allows you to boost a product based on a specific user’s search behavior. If a user typically favors the color red, you can boost the red variant of the product to the top of the group.

<img src="https://mintcdn.com/lucidworks/xQr7Fxxc7lI5hKz-/assets/images/predictive-merchandiser/product-grouping-example02.png?fit=max&auto=format&n=xQr7Fxxc7lI5hKz-&q=85&s=1c549e800fadf75a00bffe88a2a473ca" alt="Red Preference" width="603" height="859" data-path="assets/images/predictive-merchandiser/product-grouping-example02.png" />

<LwTemplate />

## Best practices

These parameters group products, and are defined in the Additional Query Parameters Stage:

| Parameter Name | Parameter Value | Update Policy                                                                                                                                                          |
| -------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| group          | true            | default                                                                                                                                                                |
| group.format   | grouped         | default                                                                                                                                                                |
| group.ngroups  | true            | default                                                                                                                                                                |
| group.field    | style\_id\_s    | default<br /><br />NOTE: You must configure `groupField=<field>` if you use [App Studio](/docs/5/fusion/dev-portal/appkit/overview) to create your search application. |

For more information about adding a query pipeline and additional query parameters, see:

* **Add a Query Pipeline Stage**
* [Additional Query Parameters Stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/set-query-params-stage)

<Accordion title="Add a Query Pipeline Stage">
  In the Query Workbench, click **Add a Stage** to add query pipeline stages that can perform query setup, results relevancy, troubleshooting, and more.

  <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-stage-add.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=a99d1f4ca656cb61e804ca149e0463e7" alt="Add a stage" width="972" height="840" data-path="assets/images/4.0/query-workbench-stage-add.png" />

  The Solr Query stage is the only pipeline stage that is required for querying processes to complete, and therefore exists in every query pipeline. It is always the last stage in a series.

  **See these pages for more information:**

  Fusion 5.x:

  * [Query Workbench](/docs/5/fusion/intro/ui-tour/query-workbench)
  * [query pipeline stages](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/overview)
  * [Solr Query stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/solr-query-stage)

  Fusion 4.x:

  * [Query Workbench](/docs/4/fusion-server/concepts/querying/query-workbench)
  * [query pipeline stages](/docs/4/fusion-server/reference/pipeline-stages/query/overview)
  * [Solr Query stage](/docs/4/fusion-server/reference/pipeline-stages/query/solr-query-stage)
</Accordion>

### Collapse/Expand parser grouping

The Collapse/Expand parser allows grouping with the following parameters:

| Parameter Name  | Parameter Value |
| --------------- | --------------- |
| expand          | true            |
| enableElevation | true            |
| group           | false           |

<Note>
  See [Collapse and Expand Results](https://solr.apache.org/guide/collapse-and-expand-results.html) for more information.
</Note>
