From 3fc7b4f7ae9bd0d091da764c3cd6afb1942d72bd Mon Sep 17 00:00:00 2001 From: Anush008 Date: Fri, 28 Jun 2024 20:35:50 +0530 Subject: [PATCH] queryBatchAsync(), vectors() overload --- src/main/java/io/qdrant/client/QdrantClient.java | 16 ++++++++++++++++ .../java/io/qdrant/client/VectorsFactory.java | 11 +++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/main/java/io/qdrant/client/QdrantClient.java b/src/main/java/io/qdrant/client/QdrantClient.java index 12313013..e71dea09 100644 --- a/src/main/java/io/qdrant/client/QdrantClient.java +++ b/src/main/java/io/qdrant/client/QdrantClient.java @@ -2782,6 +2782,22 @@ public ListenableFuture> queryAsync(QueryPoints request, @Null return Futures.transform(future, QueryResponse::getResultList, MoreExecutors.directExecutor()); } + /** + * Universally query points in batch. + * Covers all capabilities of search, recommend, discover, filters. + * Also enables hybrid and multi-stage queries. + * + * @param collectionName The name of the collection + * @param queries The queries to be performed in the batch. + * @return a new instance of {@link ListenableFuture} + */ + public ListenableFuture> queryBatchAsync( + String collectionName, + List queries + ) { + return queryBatchAsync(collectionName, queries, null, null); + } + /** * Universally query points in batch. * Covers all capabilities of search, recommend, discover, filters. diff --git a/src/main/java/io/qdrant/client/VectorsFactory.java b/src/main/java/io/qdrant/client/VectorsFactory.java index b88d7f12..a0440fe3 100644 --- a/src/main/java/io/qdrant/client/VectorsFactory.java +++ b/src/main/java/io/qdrant/client/VectorsFactory.java @@ -50,4 +50,15 @@ public static Vectors vectors(float... values) { .setVector(vector(values)) .build(); } + + /** + * Creates a vector + * @param values An instance of {@link Vector} + * @return a new instance of {@link Vectors} + */ + public static Vectors vectors(Vector vector) { + return Vectors.newBuilder() + .setVector(vector) + .build(); + } }