Skip to main content
When using Smart Groups, the same record can appear in both your and Smart Group results. Algolia automatically deduplicates results to ensure each record appears only once. You can control how duplicates are resolved by choosing a deduplication strategy.

How deduplication works

Algolia’s deduplication logic ensures a consistent and predictable user experience by:
  • Displaying only one instance of each item: Each unique objectID appears only once across organic and injected results
  • Maintaining accurate facet counts. Facet counts reflect the deduplicated result set.
  • Ensuring reliable pagination. Users can navigate through results without encountering duplicates.
When duplicate items are detected, Algolia applies your chosen strategy to determine which occurrence to keep and which to remove.

Available strategies

You can choose between two deduplication strategies when creating a composition rule. The diagram below shows how each strategy handles Item A appearing at both position 1 (organic) and position 2 (injected group): Deduplication strategy comparison

highestInjected (default)

The default highestInjected strategy prioritises items in their injected group positions. When a duplicate is found:
  • The item is kept in its injected group position.
  • The duplicate is removed from organic results (even if it appeared higher)
In the diagram: Item A stays at position 2 (injected group), removed from position 1 (organic) Use this when you want to guarantee sponsored or promoted items always appear in their designated group positions, regardless of where they normally rank.

highest

The highest strategy prioritises whichever position appears first in the results (highest on the page). When a duplicate is found:
  • The item is kept in the highest position (whether organic or injected)
  • The duplicate is removed from the lower position.
In the diagram: Item A stays at position 1 (organic), removed from position 2 (injected group) Use this when you want items to appear in their most relevant position, allowing normally high-ranking items to stay at the top even if they’re also in a promoted group.

Deduplication across multiple groups

If an objectID appears in more than one injected group, the deduplication strategy applies between groups as well:
  • The first occurrence (lowest position number) is kept.
  • Later duplicates in subsequent groups are removed.
This rule applies regardless of which strategy you choose. The strategy primarily controls deduplication between organic results and injected groups.

Configure deduplication strategy

You configure the deduplication strategy when creating or editing a composition rule in the Algolia dashboard.
You define the deduplication strategy at the composition rule level. Each rule must have its own settings.

Steps to configure

  1. Open rule settings. In the Composition Rule Editor, click the settings icon in the top right
  2. In the Manage duplicates section, select your strategy. Choose between:
    • Prioritise groups (default). Uses the highestInjected strategy.
    • Prioritise top position. Uses thehighest strategy.
  3. Click Apply to confirm, then save your composition rule.
Configure deduplication strategy in dashboard

Configure deduplication with the API

You can use theComposition API to configure the deduplication strategy programmatically. The deduplication strategy is set in the behavior.injection.deduplication.positioning parameter:
JSON
{
  "behavior": {
    "injection": {
      "deduplication": {
        "positioning": "highestInjected"
      }
    }
  }
}

Choose and apply a deduplication strategy

Different deduplication strategies affect how users experience search results Select and apply a strategy that aligns with your needs and your user’s needs:
  • Ecommerce monetisation. Use highestInjected to guarantee sponsored products appear in their paid positions.
  • Content discovery. Use highest to prioritise relevance while still promoting specific items.
  • Brand partnerships. Use highestInjected to honor paid placements or contractual obligations in campaigns.

Test with your data

Each strategy changes how users experience search results. Test both options with your actual search data to see which one works best for your users and objectives.

Be consistent across rules

For predictable user experiences, consider using the same strategy across related composition rules (for example, all rules for a specific category or product line).

See also