mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-04 02:18:29 +02:00
Switch hybrid-rrf snippets to RrfQuery API
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>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
06fbbf7fc3
commit
fc299a0e9c
+1
-1
@@ -24,7 +24,7 @@ public class Snippet
|
||||
Limit = 100
|
||||
},
|
||||
},
|
||||
Query = Fusion.Rrf,
|
||||
Query = new Rrf(),
|
||||
Limit = 100
|
||||
},
|
||||
],
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ await client.QueryAsync(
|
||||
Limit = 100
|
||||
},
|
||||
},
|
||||
Query = Fusion.Rrf,
|
||||
Query = new Rrf(),
|
||||
Limit = 100
|
||||
},
|
||||
],
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ client.Query(context.Background(), &qdrant.QueryPoints{
|
||||
Limit: qdrant.PtrOf(uint64(100)),
|
||||
},
|
||||
},
|
||||
Query: qdrant.NewQueryFusion(qdrant.Fusion_RRF),
|
||||
Query: qdrant.NewQueryRRF(&qdrant.Rrf{}),
|
||||
Limit: qdrant.PtrOf(uint64(100)),
|
||||
},
|
||||
},
|
||||
|
||||
+3
-3
@@ -5,16 +5,16 @@ import static io.qdrant.client.ExpressionFactory.expDecay;
|
||||
import static io.qdrant.client.ExpressionFactory.sum;
|
||||
import static io.qdrant.client.ExpressionFactory.variable;
|
||||
import static io.qdrant.client.QueryFactory.formula;
|
||||
import static io.qdrant.client.QueryFactory.fusion;
|
||||
import static io.qdrant.client.QueryFactory.nearest;
|
||||
import static io.qdrant.client.QueryFactory.rrf;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.DecayParamsExpression;
|
||||
import io.qdrant.client.grpc.Points.Formula;
|
||||
import io.qdrant.client.grpc.Points.Fusion;
|
||||
import io.qdrant.client.grpc.Points.PrefetchQuery;
|
||||
import io.qdrant.client.grpc.Points.QueryPoints;
|
||||
import io.qdrant.client.grpc.Points.Rrf;
|
||||
import io.qdrant.client.grpc.Points.SumExpression;
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,7 +38,7 @@ client.queryAsync(
|
||||
.setUsing("dense")
|
||||
.setLimit(100)
|
||||
.build())
|
||||
.setQuery(fusion(Fusion.RRF))
|
||||
.setQuery(rrf(Rrf.newBuilder().build()))
|
||||
.setLimit(100)
|
||||
.build())
|
||||
.setQuery(
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ client.query_points(
|
||||
limit=100,
|
||||
),
|
||||
],
|
||||
query=models.FusionQuery(fusion=models.Fusion.RRF),
|
||||
query=models.RrfQuery(rrf=models.Rrf()),
|
||||
limit=100,
|
||||
),
|
||||
query=models.FormulaQuery(
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{
|
||||
DecayParamsExpressionBuilder, Expression, FormulaBuilder, Fusion, PrefetchQueryBuilder, Query,
|
||||
QueryPointsBuilder,
|
||||
DecayParamsExpressionBuilder, Expression, FormulaBuilder, PrefetchQueryBuilder, Query,
|
||||
QueryPointsBuilder, RrfBuilder,
|
||||
};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
@@ -23,7 +23,7 @@ client.query(
|
||||
.using("dense")
|
||||
.limit(100u64),
|
||||
)
|
||||
.query(Query::new_fusion(Fusion::Rrf))
|
||||
.query(Query::new_rrf(RrfBuilder::default()))
|
||||
.limit(100u64),
|
||||
)
|
||||
.query(
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ await client.query("{collection_name}", {
|
||||
limit: 100,
|
||||
},
|
||||
],
|
||||
query: { fusion: "rrf" },
|
||||
query: { rrf: {} },
|
||||
limit: 100,
|
||||
},
|
||||
query: {
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ func Main() {
|
||||
Limit: qdrant.PtrOf(uint64(100)),
|
||||
},
|
||||
},
|
||||
Query: qdrant.NewQueryFusion(qdrant.Fusion_RRF),
|
||||
Query: qdrant.NewQueryRRF(&qdrant.Rrf{}),
|
||||
Limit: qdrant.PtrOf(uint64(100)),
|
||||
},
|
||||
},
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ POST /collections/{collection_name}/points/query
|
||||
"limit": 100
|
||||
}
|
||||
],
|
||||
"query": { "fusion": "rrf" },
|
||||
"query": { "rrf": {} },
|
||||
"limit": 100
|
||||
},
|
||||
"query": {
|
||||
|
||||
+3
-3
@@ -6,16 +6,16 @@ import static io.qdrant.client.ExpressionFactory.expDecay;
|
||||
import static io.qdrant.client.ExpressionFactory.sum;
|
||||
import static io.qdrant.client.ExpressionFactory.variable;
|
||||
import static io.qdrant.client.QueryFactory.formula;
|
||||
import static io.qdrant.client.QueryFactory.fusion;
|
||||
import static io.qdrant.client.QueryFactory.nearest;
|
||||
import static io.qdrant.client.QueryFactory.rrf;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.DecayParamsExpression;
|
||||
import io.qdrant.client.grpc.Points.Formula;
|
||||
import io.qdrant.client.grpc.Points.Fusion;
|
||||
import io.qdrant.client.grpc.Points.PrefetchQuery;
|
||||
import io.qdrant.client.grpc.Points.QueryPoints;
|
||||
import io.qdrant.client.grpc.Points.Rrf;
|
||||
import io.qdrant.client.grpc.Points.SumExpression;
|
||||
import java.util.List;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Snippet {
|
||||
.setUsing("dense")
|
||||
.setLimit(100)
|
||||
.build())
|
||||
.setQuery(fusion(Fusion.RRF))
|
||||
.setQuery(rrf(Rrf.newBuilder().build()))
|
||||
.setLimit(100)
|
||||
.build())
|
||||
.setQuery(
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ client.query_points(
|
||||
limit=100,
|
||||
),
|
||||
],
|
||||
query=models.FusionQuery(fusion=models.Fusion.RRF),
|
||||
query=models.RrfQuery(rrf=models.Rrf()),
|
||||
limit=100,
|
||||
),
|
||||
query=models.FormulaQuery(
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{
|
||||
DecayParamsExpressionBuilder, Expression, FormulaBuilder, Fusion, PrefetchQueryBuilder, Query,
|
||||
QueryPointsBuilder,
|
||||
DecayParamsExpressionBuilder, Expression, FormulaBuilder, PrefetchQueryBuilder, Query,
|
||||
QueryPointsBuilder, RrfBuilder,
|
||||
};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
@@ -23,7 +23,7 @@ pub async fn main() -> anyhow::Result<()> {
|
||||
.using("dense")
|
||||
.limit(100u64),
|
||||
)
|
||||
.query(Query::new_fusion(Fusion::Rrf))
|
||||
.query(Query::new_rrf(RrfBuilder::default()))
|
||||
.limit(100u64),
|
||||
)
|
||||
.query(
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ await client.query("{collection_name}", {
|
||||
limit: 100,
|
||||
},
|
||||
],
|
||||
query: { fusion: "rrf" },
|
||||
query: { rrf: {} },
|
||||
limit: 100,
|
||||
},
|
||||
query: {
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class Snippet
|
||||
Limit = 20
|
||||
}
|
||||
},
|
||||
query: Fusion.Rrf
|
||||
query: new Rrf()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,6 +22,6 @@ await client.QueryAsync(
|
||||
Limit = 20
|
||||
}
|
||||
},
|
||||
query: Fusion.Rrf
|
||||
query: new Rrf()
|
||||
);
|
||||
```
|
||||
|
||||
+1
-1
@@ -22,6 +22,6 @@ client.Query(context.Background(), &qdrant.QueryPoints{
|
||||
Using: qdrant.PtrOf("dense"),
|
||||
},
|
||||
},
|
||||
Query: qdrant.NewQueryFusion(qdrant.Fusion_RRF),
|
||||
Query: qdrant.NewQueryRRF(&qdrant.Rrf{}),
|
||||
})
|
||||
```
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
```java
|
||||
import static io.qdrant.client.QueryFactory.fusion;
|
||||
import static io.qdrant.client.QueryFactory.nearest;
|
||||
import static io.qdrant.client.QueryFactory.rrf;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.Fusion;
|
||||
import io.qdrant.client.grpc.Points.PrefetchQuery;
|
||||
import io.qdrant.client.grpc.Points.QueryPoints;
|
||||
import io.qdrant.client.grpc.Points.Rrf;
|
||||
import java.util.List;
|
||||
|
||||
QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
@@ -24,7 +24,7 @@ client.queryAsync(
|
||||
.setUsing("dense")
|
||||
.setLimit(20)
|
||||
.build())
|
||||
.setQuery(fusion(Fusion.RRF))
|
||||
.setQuery(rrf(Rrf.newBuilder().build()))
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
|
||||
+1
-1
@@ -17,6 +17,6 @@ client.query_points(
|
||||
limit=20,
|
||||
),
|
||||
],
|
||||
query=models.FusionQuery(fusion=models.Fusion.RRF),
|
||||
query=models.RrfQuery(rrf=models.Rrf()),
|
||||
)
|
||||
```
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{Fusion, PrefetchQueryBuilder, Query, QueryPointsBuilder};
|
||||
use qdrant_client::qdrant::{PrefetchQueryBuilder, Query, QueryPointsBuilder, RrfBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
@@ -16,6 +16,6 @@ client.query(
|
||||
.using("dense")
|
||||
.limit(20u64)
|
||||
)
|
||||
.query(Query::new_fusion(Fusion::Rrf))
|
||||
.query(Query::new_rrf(RrfBuilder::default()))
|
||||
).await?;
|
||||
```
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ client.query("{collection_name}", {
|
||||
},
|
||||
],
|
||||
query: {
|
||||
fusion: 'rrf',
|
||||
rrf: {},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
+1
-1
@@ -26,6 +26,6 @@ func Main() {
|
||||
Using: qdrant.PtrOf("dense"),
|
||||
},
|
||||
},
|
||||
Query: qdrant.NewQueryFusion(qdrant.Fusion_RRF),
|
||||
Query: qdrant.NewQueryRRF(&qdrant.Rrf{}),
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ POST /collections/{collection_name}/points/query
|
||||
"limit": 20
|
||||
}
|
||||
],
|
||||
"query": { "fusion": "rrf" }, // <--- reciprocal rank fusion
|
||||
"query": { "rrf": {} }, // <--- reciprocal rank fusion with defaults
|
||||
"limit": 10
|
||||
}
|
||||
```
|
||||
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import static io.qdrant.client.QueryFactory.fusion;
|
||||
import static io.qdrant.client.QueryFactory.nearest;
|
||||
import static io.qdrant.client.QueryFactory.rrf;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.Fusion;
|
||||
import io.qdrant.client.grpc.Points.PrefetchQuery;
|
||||
import io.qdrant.client.grpc.Points.QueryPoints;
|
||||
import io.qdrant.client.grpc.Points.Rrf;
|
||||
import java.util.List;
|
||||
|
||||
public class Snippet {
|
||||
@@ -27,7 +27,7 @@ public class Snippet {
|
||||
.setUsing("dense")
|
||||
.setLimit(20)
|
||||
.build())
|
||||
.setQuery(fusion(Fusion.RRF))
|
||||
.setQuery(rrf(Rrf.newBuilder().build()))
|
||||
.build())
|
||||
.get();
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,5 +16,5 @@ client.query_points(
|
||||
limit=20,
|
||||
),
|
||||
],
|
||||
query=models.FusionQuery(fusion=models.Fusion.RRF),
|
||||
query=models.RrfQuery(rrf=models.Rrf()),
|
||||
)
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{Fusion, PrefetchQueryBuilder, Query, QueryPointsBuilder};
|
||||
use qdrant_client::qdrant::{PrefetchQueryBuilder, Query, QueryPointsBuilder, RrfBuilder};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
@@ -16,7 +16,7 @@ pub async fn main() -> anyhow::Result<()> {
|
||||
.using("dense")
|
||||
.limit(20u64)
|
||||
)
|
||||
.query(Query::new_fusion(Fusion::Rrf))
|
||||
.query(Query::new_rrf(RrfBuilder::default()))
|
||||
).await?;
|
||||
|
||||
Ok(())
|
||||
|
||||
+1
-1
@@ -19,6 +19,6 @@ client.query("{collection_name}", {
|
||||
},
|
||||
],
|
||||
query: {
|
||||
fusion: 'rrf',
|
||||
rrf: {},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user