Skip to content

(feat): Add Composition API support with CompositionSearcher - #435

Open
afrencalg wants to merge 1 commit into
masterfrom
composition-api
Open

(feat): Add Composition API support with CompositionSearcher#435
afrencalg wants to merge 1 commit into
masterfrom
composition-api

Conversation

@afrencalg

Copy link
Copy Markdown
Contributor

Adds first-class support for the Algolia Composition API (/1/compositions/{compositionID}/run) to the instantsearch module:

CompositionSearcher: a SearcherForHits running a composition through CompositionClient, exposing the run response as a regular SearchResponse so it connects to the existing components (search box, hits, stats, facet list, filter state, paging). CompositionFacetsSearcher: facet value search via /1/compositions/{compositionID}/facets/{facetName}/query, compatible with the facet list components. FilterState connection with server-side disjunctive faceting: refined disjunctive attributes are annotated with the disjunctive() modifier in the requested facets (mirroring InstantSearch.js) instead of a client-side multi-query fan-out. Lenient response mapping from composition models to standard search models via kotlinx-serialization. New "Composition Search" showcase in the examples app (Experimental section) driving search box, stats and hits through a CompositionSearcher. Unit tests covering searcher behavior, filter state connection, params conversion, disjunctive facet annotation and response mapping.

Adds first-class support for the Algolia Composition API (/1/compositions/{compositionID}/run) to the instantsearch module:

CompositionSearcher: a SearcherForHits running a composition through CompositionClient, exposing the run response as a regular SearchResponse so it connects to the existing components (search box, hits, stats, facet list, filter state, paging).
CompositionFacetsSearcher: facet value search via /1/compositions/{compositionID}/facets/{facetName}/query, compatible with the facet list components.
FilterState connection with server-side disjunctive faceting: refined disjunctive attributes are annotated with the disjunctive() modifier in the requested facets (mirroring InstantSearch.js) instead of a client-side multi-query fan-out.
Lenient response mapping from composition models to standard search models via kotlinx-serialization.
New "Composition Search" showcase in the examples app (Experimental section) driving search box, stats and hits through a CompositionSearcher.
Unit tests covering searcher behavior, filter state connection, params conversion, disjunctive facet annotation and response mapping.
@afrencalg
afrencalg requested a review from a team as a code owner August 16, 2026 14:59
@afrencalg
afrencalg requested review from anjola-adeuyi and shaejaz and removed request for a team August 16, 2026 14:59
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 30 complexity · 10 duplication

Metric Results
Complexity 30
Duplication 10

View in Codacy

TIP This summary will be updated as you push new changes.

Comment on lines +153 to +154
text = "Compositions are configured per application in the Algolia dashboard. " +
"Enter the credentials of an application with at least one composition.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the latency app does not composition configured on it atm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants