Smart Groups let you organize and place search results based on custom logic. You can place groups of items that match specific criteria at specific positions in your search results. Smart Groups let you organize and place search results based on rules, so you don’t need to manage product positions individually. You can populate Smart Groups from these sources:Documentation Index
Fetch the complete documentation index at: https://algolia.com/llms.txt
Use this file to discover all available pages before exploring further.
- Search-based groups: you define criteria (like brand or category) and Algolia automatically selects matching items from your .
- External source groups: you provide specific object IDs from an external system (like a retail media platform or recommendation engine).
- Recommend-based groups: Algolia populates the group with items returned by an Algolia Recommend model, such as Trending Items.

Use cases
Monetize with sponsored listings (external source groups)
With external source groups, you can integrate retail media platforms to display sponsored products based on real-time bids from brand partners. This creates a new revenue stream beyond direct product sales. For example, on a search for “running shoes,” you could display two sponsored products from brands bidding through your retail media platform at positions 1 and 5, while showing organic results on the rest of the page.Retail media platforms (RMPs),
such as Criteo,
CitrusAd,
and Zitcha,
manage sponsored product campaigns, handle ad inventories, bidding, targeting, and reporting.
RMPs provide APIs to fetch sponsored products for a or category,
which you can then inject into your search results at specific positions.
Monetize your results grid (search-based groups)
Use search-based groups to highlight products or content from a preferred brand or partner. For example, you want to promote a group of products based on a contract with a particular brand, to feature them in top positions on high-grossing categories or queries. For yourFootwear category, you create a group for brand: Adidas to place two items at position 5.
Highlight new, trending, on-sale, high-margin results (search-based groups)
Promote on-sale, new, trending, highly rated, or high-margin products to support goals like increasing conversions or prioritizing high-margin items. For example, you could create a Smart Group using a on thehigh_margin: true attribute, with four items injected at position 5 in the results grid.
Create visual experiences by grouping results (search-based groups)
With Smart Groups, you can create visually cohesive experiences by grouping products or results that share similarities. For example, during autumn campaigns, highlight products with warm tones in some categories. For yourWomen category, create:
- A group filtered by the attribute
color: brownwith four items placed at position 1 in the results grid. - A group filtered by the attribute
color: creamwith four items placed at position 5 in the results grid.
You can define up to three groups per composition. You can mix search-based groups with external source groups in the same composition.
Decide between group types
The following table compares group types to help you choose the right approach:| Search-based groups | External source groups | Recommend-based groups | |
|---|---|---|---|
| Best fit when you | • Have longer-running campaigns or brand partnerships • Want to apply Algolia’s highest ranked sponsored results for specific queries or categories • Don’t have a retail media platform (RMP) | • Have an RMP for bidding, reporting, and payments • Prefer a real-time, bidding-based approach to select sponsored results | • Want to surface trending or recommended items among organic results • Already use Algolia Recommend |
| Configured through | Merchandising Studio or Composition API | Merchandising Studio + API request payload | Merchandising Studio or Composition API |
Before you begin
Whichever group type you use, make sure your setup meets these requirements:- Your Algolia application must use Algolia’s dynamic scaling infrastructure. If your application uses classic infrastructure, it must be migrated (contact your Algolia customer success manager or the support team team).
- You must have access to Merchandising Studio to curate results.
- Your application must have Smart Groups and the Composition API enabled. If you think your plan includes these features but you can’t access them, contact your Algolia account manager, customer success manager or the support team team).
Rollout and rollback considerations
To show inserted groups in your UI, integrate the Composition API with InstantSearch or an API client..- Test your implementation in development and staging environments before deploying to production.
- For A/B testing, consider using replica indices with and without inserted groups. Then associate A/B analytics with those indices.
- Keep your original Search API implementation alongside your Composition API implementation. This gives you a rollback option if the Composition API doesn’t meet your needs.
Key concepts
Composition
Composition
An entity in Algolia that helps you compose results with more control, including to insert groups into regular results. A composition is a dynamic results feed.
Results feed
Results feed
Any ranked results list of search or browse results you have on your website or app. For example, you might have UK product results feeds, a UK content results feed, a UK help results feed, and equivalents for your French website.
Composition rule
Composition rule
A rule that defines when and where to insert Smart Groups, for a given search query, category page, collection, or matching context.
Smart group
Smart group
A smart group is a group of results that match certain criteria, inserted in a specific position into the results feed. The API refers to a group as
injectedItem.Search-based groups
Search-based groups
Search-based groups use Algolia filters to automatically select items that match your criteria. You define what to promote (like
brand:Adidas AND in_stock:true), and Algolia finds which items match.Algolia’s AI-powered ranking determines which matching items are most relevant to the user’s query, ensuring promoted items still feel natural in the context of their search.External source groups
External source groups
External source groups let you specify which items to promote by providing a list of object IDs.
These object IDs come from an external system like:
- Retail media platforms
- Custom bidding or campaign management systems
Recommend-based groups
Recommend-based groups
Recommend-based groups let you populate a group with items returned by an Algolia Recommend model.
You configure them through the Composition API by setting the group source to
recommend.Composition rules and index rules
Index rules apply to both the main results (organic results before group injection) and the group results. To retrieve and rank relevant results, Algolia runs separate subqueries for both the main results and each group. Each subquery can trigger index rules. Each group subquery combines the top-level query and filters from the main results, plus any filters you’ve defined specifically for the group.
You can curate results (for example pin, hide, or further boost certain items) within a group using index rules that apply to the corresponding sub-query.
To learn more, see Curate groups.