diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
index e8478083..1c8b2ace 100644
--- a/.github/workflows/cd.yml
+++ b/.github/workflows/cd.yml
@@ -25,6 +25,9 @@ jobs:
java-version: '17'
distribution: 'temurin'
+ - name: Set Docker API version
+ run: echo "api.version=1.44" > $HOME/.docker-java.properties
+
- name: Build
uses: gradle/gradle-build-action@v2
with:
@@ -70,6 +73,9 @@ jobs:
java-version: '17'
distribution: 'temurin'
+ - name: Set Docker API version
+ run: echo "api.version=1.44" > $HOME/.docker-java.properties
+
- name: Publish package
uses: gradle/gradle-build-action@v2
with:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index ccba4a40..8cd82383 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -27,6 +27,9 @@ jobs:
java-version: '17'
distribution: 'temurin'
+ - name: Set Docker API version
+ run: echo "api.version=1.44" > $HOME/.docker-java.properties
+
- name: Build
uses: gradle/gradle-build-action@v2
with:
diff --git a/README.md b/README.md
index 0e46d89e..ecf02a6a 100644
--- a/README.md
+++ b/README.md
@@ -38,20 +38,20 @@ To install the library, add the following lines to your build config file.
io.qdrant
client
- 1.16.1
+ 1.17.0
```
#### SBT
```sbt
-libraryDependencies += "io.qdrant" % "client" % "1.16.1"
+libraryDependencies += "io.qdrant" % "client" % "1.17.0"
```
#### Gradle
```gradle
-implementation 'io.qdrant:client:1.16.1'
+implementation 'io.qdrant:client:1.17.0'
```
> [!NOTE]
diff --git a/build.gradle b/build.gradle
index ec757301..5958f546 100644
--- a/build.gradle
+++ b/build.gradle
@@ -79,8 +79,8 @@ jar {
}
}
-def grpcVersion = '1.68.2'
-def protocVersion = '3.25.4'
+def grpcVersion = '1.75.0'
+def protocVersion = '3.25.5'
def slf4jVersion = '2.0.14'
def testcontainersVersion = '1.20.1'
def jUnitVersion = '5.10.2'
diff --git a/example/Dockerfile b/example/Dockerfile
index c9e35785..46bad08a 100644
--- a/example/Dockerfile
+++ b/example/Dockerfile
@@ -1,5 +1,5 @@
# Use OpenJDK 11 as base image
-FROM openjdk:11-jdk-slim AS build
+FROM eclipse-temurin:11-jdk AS build
# Set working directory
WORKDIR /app
@@ -24,7 +24,7 @@ COPY . .
RUN gradle --no-daemon clean shadowJar
# Create a runtime image
-FROM openjdk:11-jre-slim
+FROM eclipse-temurin:11-jre
WORKDIR /app
diff --git a/example/build.gradle b/example/build.gradle
index e79263a4..b2754881 100644
--- a/example/build.gradle
+++ b/example/build.gradle
@@ -13,7 +13,7 @@ repositories {
dependencies {
// Qdrant Java client
- implementation 'io.qdrant:client:1.16.1'
+ implementation 'io.qdrant:client:1.17.0'
// gRPC dependencies - use the same version as Qdrant client
implementation 'io.grpc:grpc-netty-shaded:1.65.1'
diff --git a/gradle.properties b/gradle.properties
index e760cbf4..3d3e8ab4 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,8 +1,8 @@
# The version of qdrant to use to download protos
-qdrantProtosVersion=v1.16.0
+qdrantProtosVersion=v1.17.0
# The version of qdrant docker image to run integration tests against
-qdrantVersion=v1.16.0
+qdrantVersion=v1.17.0
# The version of the client to generate
-packageVersion=1.16.1
+packageVersion=1.17.0
diff --git a/src/main/java/io/qdrant/client/QdrantClient.java b/src/main/java/io/qdrant/client/QdrantClient.java
index 717e798f..42edf51a 100644
--- a/src/main/java/io/qdrant/client/QdrantClient.java
+++ b/src/main/java/io/qdrant/client/QdrantClient.java
@@ -32,10 +32,13 @@
import io.qdrant.client.grpc.Collections.ListCollectionAliasesRequest;
import io.qdrant.client.grpc.Collections.ListCollectionsRequest;
import io.qdrant.client.grpc.Collections.ListCollectionsResponse;
+import io.qdrant.client.grpc.Collections.ListShardKeysRequest;
+import io.qdrant.client.grpc.Collections.ListShardKeysResponse;
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
import io.qdrant.client.grpc.Collections.RenameAlias;
import io.qdrant.client.grpc.Collections.ShardKey;
+import io.qdrant.client.grpc.Collections.ShardKeyDescription;
import io.qdrant.client.grpc.Collections.UpdateCollection;
import io.qdrant.client.grpc.Collections.UpdateCollectionClusterSetupRequest;
import io.qdrant.client.grpc.Collections.UpdateCollectionClusterSetupResponse;
@@ -926,6 +929,37 @@ public ListenableFuture deleteShardKeyAsync(
MoreExecutors.directExecutor());
}
+ /**
+ * List the shard keys of a collection.
+ *
+ * @param collectionName The name of the collection to list shard keys for.
+ * @return a new instance of {@link ListenableFuture}
+ */
+ public ListenableFuture> listShardKeysAsync(String collectionName) {
+ return listShardKeysAsync(collectionName, null);
+ }
+
+ /**
+ * List the shard keys of a collection.
+ *
+ * @param collectionName The name of the collection to list shard keys for.
+ * @param timeout The timeout for the call.
+ * @return a new instance of {@link ListenableFuture}
+ */
+ public ListenableFuture> listShardKeysAsync(
+ String collectionName, @Nullable Duration timeout) {
+ Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty");
+ logger.debug("List shard keys for '{}'", collectionName);
+
+ ListenableFuture future =
+ getCollections(timeout)
+ .listShardKeys(
+ ListShardKeysRequest.newBuilder().setCollectionName(collectionName).build());
+ addLogFailureCallback(future, "List Shard Keys");
+ return Futures.transform(
+ future, response -> response.getShardKeysList(), MoreExecutors.directExecutor());
+ }
+
// endregion
// region Point Management
diff --git a/src/main/java/io/qdrant/client/QdrantGrpcClient.java b/src/main/java/io/qdrant/client/QdrantGrpcClient.java
index e0ecf758..3e0364c6 100644
--- a/src/main/java/io/qdrant/client/QdrantGrpcClient.java
+++ b/src/main/java/io/qdrant/client/QdrantGrpcClient.java
@@ -192,16 +192,14 @@ public void close() {
public static class Builder {
private final ManagedChannel channel;
private final boolean shutdownChannelOnClose;
+ private final boolean checkCompatibility;
@Nullable private CallCredentials callCredentials;
@Nullable private Duration timeout;
Builder(ManagedChannel channel, boolean shutdownChannelOnClose, boolean checkCompatibility) {
this.channel = channel;
this.shutdownChannelOnClose = shutdownChannelOnClose;
- String clientVersion = Builder.class.getPackage().getImplementationVersion();
- if (checkCompatibility) {
- checkVersionsCompatibility(clientVersion);
- }
+ this.checkCompatibility = checkCompatibility;
}
Builder(String host, int port, boolean useTransportLayerSecurity, boolean checkCompatibility) {
@@ -210,9 +208,7 @@ public static class Builder {
String userAgent = "java-client/" + clientVersion + " java/" + javaVersion;
this.channel = createChannel(host, port, useTransportLayerSecurity, userAgent);
this.shutdownChannelOnClose = true;
- if (checkCompatibility) {
- checkVersionsCompatibility(clientVersion);
- }
+ this.checkCompatibility = checkCompatibility;
}
/**
@@ -255,6 +251,10 @@ public Builder withCallCredentials(@Nullable CallCredentials callCredentials) {
* @return a new instance of {@link QdrantGrpcClient}
*/
public QdrantGrpcClient build() {
+ if (checkCompatibility) {
+ String clientVersion = Builder.class.getPackage().getImplementationVersion();
+ checkVersionsCompatibility(clientVersion);
+ }
return new QdrantGrpcClient(channel, shutdownChannelOnClose, callCredentials, timeout);
}
@@ -277,6 +277,7 @@ private void checkVersionsCompatibility(String clientVersion) {
try {
String serverVersion =
QdrantGrpc.newBlockingStub(this.channel)
+ .withCallCredentials(this.callCredentials)
.healthCheck(QdrantOuterClass.HealthCheckRequest.getDefaultInstance())
.getVersion();
if (!VersionsCompatibilityChecker.isCompatible(clientVersion, serverVersion)) {
diff --git a/src/main/java/io/qdrant/client/QueryFactory.java b/src/main/java/io/qdrant/client/QueryFactory.java
index 40a283c0..12d5f0d9 100644
--- a/src/main/java/io/qdrant/client/QueryFactory.java
+++ b/src/main/java/io/qdrant/client/QueryFactory.java
@@ -16,6 +16,7 @@
import io.qdrant.client.grpc.Points.OrderBy;
import io.qdrant.client.grpc.Points.Query;
import io.qdrant.client.grpc.Points.RecommendInput;
+import io.qdrant.client.grpc.Points.RelevanceFeedbackInput;
import io.qdrant.client.grpc.Points.Rrf;
import io.qdrant.client.grpc.Points.Sample;
import io.qdrant.client.grpc.Points.VectorInput;
@@ -253,5 +254,15 @@ public static Query sample(Sample sample) {
return Query.newBuilder().setSample(sample).build();
}
+ /**
+ * Creates a {@link Query} for search with feedback from some oracle.
+ *
+ * @param relevanceFeedback An instance of {@link RelevanceFeedbackInput}
+ * @return A new instance of {@link Query}
+ */
+ public static Query relevanceFeedback(RelevanceFeedbackInput relevanceFeedback) {
+ return Query.newBuilder().setRelevanceFeedback(relevanceFeedback).build();
+ }
+
// endregion
}