Skip to main content
Search-based groups let you automatically promote items that match specific criteria, like brand, category, or custom attributes. You define what to promote (with filters), and Algolia determines which items match, applying its AI-powered ranking to ensure the most relevant results appear. For sponsored listings powered by retail media platforms or external recommendation engines, see external source groups. Before you begin, review the Composition API prerequisites.

Create your groups in Merchandising Studio

Create and manage compositions and composition rules in Merchandising Studio. The HTTP APIs, API clients, and Algolia dashboard don’t support these tasks. Creating groups involves two procedures: creating a composition and creating its rules.

Create a composition

Compositions help you compose dynamic result feeds with more control.
1

Open the composition creator

Go to the Merchandising Studio and open the Merch tools page. Select the Search all compositions and indices menu and click + Create Composition.Merchandising Studio with index selector menu and a button that lets you create a new composition
2

Configure the composition

In the New Composition menu, enter a name for this dynamic results , and an optional description. Select which main should be associated with this results feed.New compositions menu with name, description, and main index fieldsCreate one composition per index. If you have different sites, for example, for different geographical regions, create one composition per site and index, such as “Product results feed - US”. Each composition can have rules for the insertion of groups. If you have five sites and one product index each, you need five compositions. Give each composition a short, descriptive, and unique name, and select its main source index.After creating your first composition, you can find it in the Search all compositions and indices menu. To list all your compositions and create new ones, go to the Compositions section in the sidebar and click All Compositions.

Create composition rules

To insert a curated group of results for a specific query, category page, or collection, define and publish a composition rule.
1

Open Composition Rules

Use the Index and Compositions selector to select the relevant composition. Go to the Merchandising Studio’s Merch tools > Compositions > Composition Rules page.
Besides Merch tools, you can use Merchandising Studio’s Visual Merchandiser to manage both composition and index rules in a single visual workflow. Go to Visual Merchandiser, select the relevant composition, , category, or collection, then click Actions.
2

Create a composition rule

Click New Composition Rule.
3

Configure group placement

In the compositions rules editor, configure where to insert your groups given specific conditions, and based on which filters match the group results.
4

Specify the trigger conditions

Specify the conditions for triggering your composition rule, for example, search queries, categories, collections and contexts.In the Composition Rule Editor, add a Category ConditionYou can select several queries, categories, and collections if you want to inject the same groups for them.
5

Add groups

Add the groups you would like to create. Select Algolia Index as the data source, then use filters with ‘and’ as well as ‘or’ operations to curate the items that should appear in the group. Specify the group’s starting position in the results, as well as the number of matching to include.Screenshot of the 'Add group' panel with fields for 'Group name', 'Position', 'Quantity', and 'Source Index', and filters for 'brand is Samsung'.To add a group from a collection, on the _collections attribute.
6

Save the composition rule

Save the group and then the composition rule to apply it.If not enough records match the filter criteria, a group might have fewer items than you specified. The included records can vary at query-time, based on their real-time attribute values as well as applied ranking criteria and index-level rules.

Curate groups

You can curate groups further, that is, change the behavior of the query used to retrieve and rank the group’s items, by applying Index Rules to it (for example, for a group with promoted Adidas items, the group’s sub-query might be query=“shoes” and filter: “brand”=“Adidas”). For more information, see Composition rules and index rules. For example, you can pin, hide, or boost items within the group:
  1. Go to Merchandising Studio’s Visual Merchandiser.
  2. Select the corresponding Composition and Search query/Category/Collection where the group’s Composition Rule is applied.
  3. Click Actions > Curate “group name” (or find the group in the visual preview, click the three dots, then select “Curate group”).
  4. The Index Rule Visual Editor will open, allowing you to define Consequences (for example pin or hide items) for the group’s sub-query.
  5. Publish the Index Rule.
The Index Rule is applied to all queries that trigger its conditions—both in the context of the group and in a direct query (in the preceding example other “shoes” queries with the Adidas filter). The final results might be different to the ones shown in the Index Rules preview, due to the deduplication between the main query and groups. For example, an item might already be part of a previous group and thus not show in the final results in a later group. You may see more items than the ones shown in the final group, when there are more items that match the criteria than the quantity or length of the group is.

Integrate compositions

Integrating compositions and smart groups involves these steps:
1

Copy your API credentials

In the Algolia dashboard, go to Settings > API Keys and copy your and . The API key needs at least search permissions for the index used in your composition.
2

Copy the composition ID

In Merchandising Studio, go to Merch tools > Compositions > Composition Rules and select the composition from the Composition or Index selector. Copy the composition ID to your clipboard.Screenshot of a search box in the 'Composition Rules' section, showing a composition ID with a 'Copy composition ID to clipboard' tooltip.
3

Choose an integration method

Query the Composition API with API clients or InstantSearch for web.
Indexing remains the same, with your previous indexing mechanism (for example, the Search API or indexing connectors). You might need to add extra attributes for identifying groups if this information isn’t already indexed.

Integrate compositions with API clients

Use the Composition API client in one of the supported programming languages.

Integrate compositions with InstantSearch

Start by replacing the Search API client with the Composition API client. Compositions require these versions of the InstantSearch libraries: Compositions have the following limitations:
  • The Shopify, Magento, and BigCommerce frontend integrations and the default Salesforce B2C Commerce frontend integration aren’t supported.
  • You can’t use the index widget.
  • You can’t combine Composition API calls with Search API or Recommend API calls on the same page.
  • You can’t show groups in autocomplete menus, but you can open a composition-based search results page from there.

Facets (including disjunctive faceting)

Disjunctive faceting lets users combine values of the same with OR. For example, users can filter the brand facet by Nike or Adidas. When querying the Composition API, add the disjunctive modifier to a facet to return accurate values and counts while that facet is filtered. For example:
JavaScript
InstantSearch handles this automatically.
Each request has a limit of 20 disjunctive facets. Using facet display in InstantSearch with more than 20 facets is also not supported.

Events setup

When sending click and conversion events, you still need to send the underlying index name as indexName attribute with your events, not the composition ID. No further changes are needed.
InstantSearch’s events tracking mechanism handles passing the underlying index name for you, if you’re using the specified versions of the packages.

Next steps

Use index rules with composition rules to curate group results. For details, see Composition rules and index rules.
When enabled on your index, Dynamic Re-Ranking re-ranks both main results and results in groups.
You can set up a composition for your replica index. Then, you can curate the replica feed like a standard results feed.
Each group needs a unique start position. If group ranges overlap, Algolia shifts the group with the higher start position to the next available positions.For example, group A has three products starting at position 1, and group B has three starting at position 2. The final order is A.1, A.2, A.3, B.1, B.2, B.3, followed by the main results at position 7.
Algolia removes duplicates across and groups. By default, the highestInjected strategy keeps the item in its group position instead of in organic results.To choose different behavior, configure the deduplication strategy in the composition rule.
Last modified on July 29, 2026