Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ To install the library, add the following lines to your build config file.
<dependency>
<groupId>io.qdrant</groupId>
<artifactId>client</artifactId>
<version>1.16.2</version>
<version>1.17.0</version>
</dependency>
```

#### SBT

```sbt
libraryDependencies += "io.qdrant" % "client" % "1.16.2"
libraryDependencies += "io.qdrant" % "client" % "1.17.0"
```

#### Gradle

```gradle
implementation 'io.qdrant:client:1.16.2'
implementation 'io.qdrant:client:1.17.0'
```

> [!NOTE]
Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {

dependencies {
// Qdrant Java client
implementation 'io.qdrant:client:1.16.2'
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'
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The version of qdrant to use to download protos
qdrantProtosVersion=v1.16.2
qdrantProtosVersion=v1.17.0

# The version of qdrant docker image to run integration tests against
qdrantVersion=v1.16.2
qdrantVersion=v1.17.0

# The version of the client to generate
packageVersion=1.16.2
packageVersion=1.17.0
34 changes: 34 additions & 0 deletions src/main/java/io/qdrant/client/QdrantClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -926,6 +929,37 @@ public ListenableFuture<DeleteShardKeyResponse> 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<List<ShardKeyDescription>> 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<List<ShardKeyDescription>> listShardKeysAsync(
String collectionName, @Nullable Duration timeout) {
Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty");
logger.debug("List shard keys for '{}'", collectionName);

ListenableFuture<ListShardKeysResponse> 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
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/io/qdrant/client/QueryFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}
Loading