mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 12:58:31 +02:00
This commit both: - Fixes pre-existing mistakes in snippets, aka wrong code samples. - Adds hidden (`@hide`) statements that do not appear in the docs, but satisfy typecheckers.
27 lines
1.0 KiB
Java
27 lines
1.0 KiB
Java
package com.example.snippets_amalgamation;
|
|
|
|
import static io.qdrant.client.QueryFactory.nearest;
|
|
|
|
import io.qdrant.client.grpc.Points.QueryPointGroups;
|
|
import io.qdrant.client.grpc.Points.SearchPointGroups;
|
|
import java.util.List;
|
|
|
|
public class Snippet {
|
|
public static void run() throws Exception {
|
|
// @hide-start
|
|
io.qdrant.client.QdrantClient client =
|
|
new io.qdrant.client.QdrantClient(io.qdrant.client.QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
|
// @hide-end
|
|
|
|
client.queryGroupsAsync(
|
|
QueryPointGroups.newBuilder()
|
|
.setCollectionName("{collection_name}")
|
|
.setQuery(nearest(0.2f, 0.1f, 0.9f, 0.7f))
|
|
.setGroupBy("document_id")
|
|
.setLimit(4)
|
|
.setGroupSize(2)
|
|
.build())
|
|
.get();
|
|
}
|
|
}
|