Skip to content

Inner reads return at most 50 documents #2599

Description

@Hazel-Datastax

Current behavior

Why fix it

  • A filter leg with rerankCandidateLimit: 100 silently reads only 50 documents. There is no error and no warning.
  • Single vector and lexical legs would also have to push rerankCandidateLimit through the hack.
  • Capping rerankCandidateLimit at 50 doesn't avoid the problem. defaultPageSize is configurable, so the real cap can change per environment.
  • Hidden shared state makes it hard to see who writes the value and who reads it. Every new leg type adds one more place to remember.

Implementation split and acceptance criteria

This foundation keeps the current public request syntax and is split across two dependent PRs:

  1. Resolve internal candidate reads through resolveCollectionCandidateCommand, requiring a positive explicit inner options.limit. Derive vector/BM25 page sizes from that command and remove CommandContext.hybridLimits coupling. Preserve asymmetric leg budgets.
  2. Add an internal candidate read mode that follows continuation pages until its budget is filled or results are exhausted. Use fresh state per subscription and sequential query fanout within each leg. Sorted reads already scan continuation pages, so retain that full scan and maxDocumentSortCount safeguard while removing the ordinary result-page cap for candidate reads.

Acceptance coverage includes underfilled and empty pages with continuation, early exhaustion, stopping without an extra fetch, later-page failures, shared budgets across generated queries, repeated subscriptions, and sorted/unsorted candidate counts above 50. Ordinary find pagination and sorting remain unchanged. Candidate limits apply before passage filtering, with no replacement reads for discarded passages. Successful HTTP reranking coverage is tracked in #2600.

Public single-leg syntax and candidate-limit configuration remain in #2601/#2602, and public filter retrieval/scoring remains in #2603.

Draft PRs

PR #2606 makes candidate sizing explicit. PR #2607 completes bounded collection and depends on #2606, which depends on #2605.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions