> ## 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.

# Document 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/experience-optimizer/eo-document-grouping

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/getting-data-out/curating-your-search-experience/experience-optimizer/eo-document-grouping

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

Experience Optimizer makes it easy to group documents together so they can be presented to the user. This can be useful when you want to show several documents that are relevant to each other, for example.

<img src="https://mintcdn.com/lucidworks/aJg00sncwy9AQv3p/assets/images/experience-optimizer/eo-result-list.png?fit=max&auto=format&n=aJg00sncwy9AQv3p&q=85&s=3eb3b406d5a2114c4881e827fad2ead4" alt="result list" width="1101" height="544" data-path="assets/images/experience-optimizer/eo-result-list.png" />

Document groups can be boosted or blocked. If you want to promote a document group that is new, for example, you can boost the group to the top of the results.

You can still apply rules individually to documents within a group. This allows you to boost a document based on a specific user’s search behavior. If a user that is typically interested in ballet searches for "dance" content, you can boost ballet-related articles to the top of the group.

<img src="https://mintcdn.com/lucidworks/aJg00sncwy9AQv3p/assets/images/experience-optimizer/eo-boost-ballet.png?fit=max&auto=format&n=aJg00sncwy9AQv3p&q=85&s=6d4e81db2dc41eb3acaa58ac61a52c98" alt="ballet boost" width="1104" height="699" data-path="assets/images/experience-optimizer/eo-boost-ballet.png" />

<LwTemplate />

## Best practices

These parameters group documents, 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>
