Azure / Azure/azure-sdk-for-rust

Support vector and hybrid search queries

Open
#4,752 0 comments 1 reaction 1 assignee Claimed by @simorenoh View on GitHub
Client Cosmos
Dominant language
Rust
Stars
884
Forks
365
Avg merge
2d 19h
Merged PRs (30d)
112

Description

### 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/`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.