Before you begin
- Review the Composition API prerequisites.
- The in the Recommend source needs a trained Recommend model. For data and event requirements, see Recommend models.
Supported Recommend models
Recommend-based groups support only theTrending items model.
Frequently bought together, Related items, Related content, and Looking similar aren’t supported.
Configure a Recommend-based group
Configure Recommend-based groups with the Update and insert Composition API endpoint. In theinjectedItems array, each entry uses a source.recommend object to reference a Recommend model:
JSON
Use Recommend as the source for main feed results
You can also use a Recommend model as the source for the main organic results, not only for an injected group. Setinjection.main.source.recommend instead of injection.main.source.search:
JSON
Behavior details
Recommend-based groups behave like search-based groups for filtering, ranking, and deduplication:- Filters. Use
queryParametersandfallbackParametersto constrain the items returned by the model, for example by category or stock status. - Deduplication. Algolia deduplicates items between organic results and injected groups using the configured strategy. See Choose how to deduplicate results.
- Composition rules and index rules. Composition rules apply on top of index rules..