Skip to content

Cut the faceted page to a single engine round-trip (overlap + ride the listing search) #556

Description

@ddeboer

Context

After #532 (PR #554), a faceted page costs 2 engine round-trips: the listing search, then — only once it resolves — the batched facet multi_search. The facet queries derive solely from the resolved SearchQuery, not from the listing result, so the second round-trip need not wait for (or even be separate from) the first.

Proposal

Two composable steps, in order of effort:

  1. Overlap: let the root resolver return its source synchronously with the listing search as a pending promise (items/total sub-resolvers await it), so the facet dispatch fires in the same tick and the two round-trips run concurrently — max() instead of sum.
  2. Merge: facets whose effective where (after skip-own-filter) equals the listing query’s where can ride the listing search via facet_by — the common unfiltered browse becomes 1 round-trip. Needs the root resolver to read the facet selection from GraphQLResolveInfo (including fragments), which ADR 4 anticipates (‘selection is the request’).

Acceptance

  • Unfiltered browse: 1 Typesense round-trip (listing + facets in one search); filtered pages: concurrent, not sequential, round-trips.
  • Facet counts, skip-own-filter semantics, per-facet failure isolation, and the GraphQL contract unchanged.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions