Files
landing_page/qdrant-landing/content/documentation/headless/snippets/query-groups/basic/java.java
T
xzfc 74a785218b Fix type-checking errors in snippets (code only, no .md)
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.
2025-11-28 22:02:07 +00:00

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();
}
}