mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 21:08:31 +02:00
Replaces the older `FusionQuery(fusion=Fusion.RRF)` enum form with
`RrfQuery(rrf=Rrf())` across all language tabs (Python, TypeScript,
Rust, Go, Java, C#) plus the REST body in `http.md`, for both the
`hybrid-rrf/` snippet and the inner RRF prefetch inside
`hybrid-formula-decay/`. The newer dedicated `Rrf` message is the
recommended path going forward; the old enum stays supported for
backward compatibility. Server-side both forms converge to the same
`FusionInternal::Rrf { k: 2, weights: None }`, verified against the
qdrant/qdrant source.
`generated/*.md` files in both directories regenerated via
`./docker.sh ./generate-md.py`. `./docker.sh ./check.py build` passes
across all six SDKs.
Also softens the DBSF prose in hybrid-queries.md to drop the
"weighted RRF tends to win" framing. Neither method dominates the
other in general.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
24 lines
803 B
Rust
24 lines
803 B
Rust
use qdrant_client::Qdrant;
|
|
use qdrant_client::qdrant::{PrefetchQueryBuilder, Query, QueryPointsBuilder, RrfBuilder};
|
|
|
|
pub async fn main() -> anyhow::Result<()> {
|
|
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
|
|
|
client.query(
|
|
QueryPointsBuilder::new("{collection_name}")
|
|
.add_prefetch(PrefetchQueryBuilder::default()
|
|
.query(Query::new_nearest([(1, 0.22), (42, 0.8)].as_slice()))
|
|
.using("sparse")
|
|
.limit(20u64)
|
|
)
|
|
.add_prefetch(PrefetchQueryBuilder::default()
|
|
.query(Query::new_nearest(vec![0.01, 0.45, 0.67]))
|
|
.using("dense")
|
|
.limit(20u64)
|
|
)
|
|
.query(Query::new_rrf(RrfBuilder::default()))
|
|
).await?;
|
|
|
|
Ok(())
|
|
}
|