mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 12:58:31 +02:00
@@ -0,0 +1,27 @@
|
||||
```java
|
||||
import static io.qdrant.client.QueryFactory.nearest;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points;
|
||||
import io.qdrant.client.grpc.Points.Document;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(
|
||||
QdrantGrpcClient.newBuilder("xyz-example.qdrant.io", 6334, true)
|
||||
.withApiKey("<your-api-key")
|
||||
.build());
|
||||
client
|
||||
.queryAsync(
|
||||
Points.QueryPoints.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setQuery(
|
||||
nearest(
|
||||
Document.newBuilder()
|
||||
.setModel("qdrant/bm25")
|
||||
.setText("How to bake cookies?")
|
||||
.build()))
|
||||
.setUsing("my-bm25-vector")
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
Reference in New Issue
Block a user