diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6a62e24..7c22377 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -35,7 +35,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: gradle-version: 8.5 - arguments: test + arguments: test --info - name: Test Results uses: mikepenz/action-junit-report@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53b17db..ccba4a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,10 +31,10 @@ jobs: uses: gradle/gradle-build-action@v2 with: gradle-version: 8.5 - arguments: build + arguments: build --info - name: Test uses: gradle/gradle-build-action@v2 with: gradle-version: 8.5 - arguments: test + arguments: test --info diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c420d3..e9efc46 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ We love your input! We want to make contributing to this project as easy and tra ## We Develop with GitHub -We use github to host code, to track issues and feature requests, as well as accept pull requests. +We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. We Use [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow), so all code changes happen through Pull Requests. Pull requests are the best way to propose changes to the codebase. diff --git a/README.md b/README.md index 1f91f38..b12e649 100644 --- a/README.md +++ b/README.md @@ -34,20 +34,20 @@ To install the library, add the following lines to your build config file. io.qdrant client - 1.12.0 + 1.13.0 ``` #### SBT ```sbt -libraryDependencies += "io.qdrant" % "client" % "1.12.0" +libraryDependencies += "io.qdrant" % "client" % "1.13.0" ``` #### Gradle ```gradle -implementation 'io.qdrant:client:1.11.0' +implementation 'io.qdrant:client:1.13.0' ``` > [!NOTE] diff --git a/gradle.properties b/gradle.properties index 32efcbd..db5d739 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ # The version of qdrant to use to download protos -qdrantProtosVersion=v1.12.0 +qdrantProtosVersion=v1.13.0 # The version of qdrant docker image to run integration tests against -qdrantVersion=v1.12.0 +qdrantVersion=v1.13.0 # The version of the client to generate -packageVersion=1.12.0 +packageVersion=1.13.0 diff --git a/src/main/java/io/qdrant/client/ConditionFactory.java b/src/main/java/io/qdrant/client/ConditionFactory.java index 032bccf..454390d 100644 --- a/src/main/java/io/qdrant/client/ConditionFactory.java +++ b/src/main/java/io/qdrant/client/ConditionFactory.java @@ -10,6 +10,7 @@ import io.qdrant.client.grpc.Points.GeoPolygon; import io.qdrant.client.grpc.Points.GeoRadius; import io.qdrant.client.grpc.Points.HasIdCondition; +import io.qdrant.client.grpc.Points.HasVectorCondition; import io.qdrant.client.grpc.Points.IsEmptyCondition; import io.qdrant.client.grpc.Points.IsNullCondition; import io.qdrant.client.grpc.Points.Match; @@ -391,4 +392,16 @@ public static Condition datetimeRange(String field, DatetimeRange datetimeRange) .setField(FieldCondition.newBuilder().setKey(field).setDatetimeRange(datetimeRange).build()) .build(); } + + /** + * Matches records where a value for the given vector is present. + * + * @param vector The name of the vector. + * @return a new instance of {@link Condition} + */ + public static Condition hasVector(String vector) { + return Condition.newBuilder() + .setHasVector(HasVectorCondition.newBuilder().setHasVector(vector).build()) + .build(); + } } diff --git a/src/main/java/io/qdrant/client/VectorInputFactory.java b/src/main/java/io/qdrant/client/VectorInputFactory.java index cc5a643..8cddfb2 100644 --- a/src/main/java/io/qdrant/client/VectorInputFactory.java +++ b/src/main/java/io/qdrant/client/VectorInputFactory.java @@ -4,6 +4,9 @@ import com.google.common.primitives.Floats; import io.qdrant.client.grpc.Points.DenseVector; +import io.qdrant.client.grpc.Points.Document; +import io.qdrant.client.grpc.Points.Image; +import io.qdrant.client.grpc.Points.InferenceObject; import io.qdrant.client.grpc.Points.MultiDenseVector; import io.qdrant.client.grpc.Points.PointId; import io.qdrant.client.grpc.Points.SparseVector; @@ -97,7 +100,7 @@ public static VectorInput vectorInput(long id) { /** * Creates a {@link VectorInput} from a {@link UUID} * - * @param id The pint id + * @param id The point id * @return a new instance of {@link VectorInput} */ public static VectorInput vectorInput(UUID id) { @@ -107,10 +110,40 @@ public static VectorInput vectorInput(UUID id) { /** * Creates a {@link VectorInput} from a {@link PointId} * - * @param id The pint id + * @param id The point id * @return a new instance of {@link VectorInput} */ public static VectorInput vectorInput(PointId id) { return VectorInput.newBuilder().setId(id).build(); } + + // /** + // * Creates a {@link VectorInput} from a {@link Document} + // * + // * @param document An instance of {@link Document} + // * @return a new instance of {@link VectorInput} + // */ + // public static VectorInput vectorInput(Document document) { + // return VectorInput.newBuilder().setDocument(document).build(); + // } + + // /** + // * Creates a {@link VectorInput} from a an {@link Image} + // * + // * @param image An instance of {@link Image} + // * @return a new instance of {@link VectorInput} + // */ + // public static VectorInput vectorInput(Image image) { + // return VectorInput.newBuilder().setImage(image).build(); + // } + + // /** + // * Creates a {@link VectorInput} from a {@link InferenceObject} + // * + // * @param object An instance of {@link InferenceObject} + // * @return a new instance of {@link VectorInput} + // */ + // public static VectorInput vectorInput(InferenceObject object) { + // return VectorInput.newBuilder().setObject(object).build(); + // } } diff --git a/src/test/java/io/qdrant/client/PointsTest.java b/src/test/java/io/qdrant/client/PointsTest.java index a999980..efe460d 100644 --- a/src/test/java/io/qdrant/client/PointsTest.java +++ b/src/test/java/io/qdrant/client/PointsTest.java @@ -52,7 +52,7 @@ import io.qdrant.client.grpc.Points.SearchPoints; import io.qdrant.client.grpc.Points.UpdateResult; import io.qdrant.client.grpc.Points.UpdateStatus; -import io.qdrant.client.grpc.Points.Vectors; +import io.qdrant.client.grpc.Points.VectorsOutput; import java.util.Arrays; import java.util.List; import java.util.concurrent.ExecutionException; @@ -111,7 +111,7 @@ public void retrieve() throws ExecutionException, InterruptedException { assertEquals(ImmutableSet.of("foo", "bar", "date"), point.getPayloadMap().keySet()); assertEquals(value("goodbye"), point.getPayloadMap().get("foo")); assertEquals(value(2), point.getPayloadMap().get("bar")); - assertEquals(Vectors.getDefaultInstance(), point.getVectors()); + assertEquals(VectorsOutput.getDefaultInstance(), point.getVectors()); } @Test @@ -125,7 +125,8 @@ public void retrieve_with_vector_without_payload() RetrievedPoint point = points.get(0); assertEquals(id(8), point.getId()); assertTrue(point.getPayloadMap().isEmpty()); - assertEquals(Vectors.VectorsOptionsCase.VECTOR, point.getVectors().getVectorsOptionsCase()); + assertEquals( + VectorsOutput.VectorsOptionsCase.VECTOR, point.getVectors().getVectorsOptionsCase()); } @Test