mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-11 05:48: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.
26 lines
963 B
Java
26 lines
963 B
Java
package com.example.snippets_amalgamation;
|
|
|
|
import static io.qdrant.client.ConditionFactory.matchKeyword;
|
|
|
|
import io.qdrant.client.QdrantClient;
|
|
import io.qdrant.client.QdrantGrpcClient;
|
|
import io.qdrant.client.grpc.Common.Filter;
|
|
import io.qdrant.client.grpc.Points.SearchMatrixPoints;
|
|
|
|
public class Snippet {
|
|
public static void run() throws Exception {
|
|
QdrantClient client =
|
|
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
|
|
|
client
|
|
.searchMatrixPairsAsync(
|
|
SearchMatrixPoints.newBuilder()
|
|
.setCollectionName("{collection_name}")
|
|
.setFilter(Filter.newBuilder().addMust(matchKeyword("color", "red")).build())
|
|
.setSample(10)
|
|
.setLimit(2)
|
|
.build())
|
|
.get();
|
|
}
|
|
}
|