Skip to content

Support vector and hybrid search queries #4752

Description

@tvaron3

Feature Summary

Add production vector-only and hybrid vector/full-text cross-partition search execution to the Cosmos DB Rust driver.

Feature Description

Build separate vector-only ORDER BY and HybridSearchQueryInfo paths, then compose and fuse their result streams according to the query plan.

Validation and acceptance criteria:

  • Distinguish vector-only ORDER BY plans from HybridSearchQueryInfo plans.
  • Retrieve and apply optional global full-text statistics when required by the plan.
  • Build component query pipelines and consume their score/result envelopes.
  • Apply component scores and configured weights correctly.
  • Produce deterministic reciprocal-rank fusion results with stable tie handling.
  • Apply skip/take semantics after fusion.
  • Initially reject external continuation tokens explicitly.
  • Cover vector-only, vector plus full-text, weights, missing statistics, invalid or empty components, ties, and partition splits.

Use Case

Applications need globally ranked vector and hybrid search results across partitions using Cosmos query-plan scoring and fusion semantics.

Alternatives

Running independent searches and fusing them in application code loses query-plan composition, global statistics, deterministic ranking, diagnostics, and partition-aware behavior.

Additional Context

Implement under sdk/cosmos/azure_data_cosmos_driver/src/driver/dataflow/. This depends on the parent issue's pipeline factory, score/statistics envelopes, buffering limits, response transformation, stage ordering, and non-resumable continuation policy. Cross-SDK references: .NET CrossPartition HybridSearch stage/result/statistics types and HybridSearchQueryTests; Java HybridSearchDocumentQueryExecutionContext, HybridSearchDocumentProducer, and hybridsearch/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.CosmosThe azure_cosmos crate

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions