Skip to content
Open
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: 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.18.3</version>
<version>1.19.0</version>
</dependency>
```

#### SBT

```sbt
libraryDependencies += "io.qdrant" % "client" % "1.18.3"
libraryDependencies += "io.qdrant" % "client" % "1.19.0"
```

#### Gradle

```gradle
implementation 'io.qdrant:client:1.18.3'
implementation 'io.qdrant:client:1.19.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.18.3'
implementation 'io.qdrant:client:1.19.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.18.0
qdrantProtosVersion=dev

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

# The version of the client to generate
packageVersion=1.18.3
packageVersion=1.19.0
33 changes: 33 additions & 0 deletions src/main/java/io/qdrant/client/ConditionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.qdrant.client.grpc.Common.Range;
import io.qdrant.client.grpc.Common.RepeatedIntegers;
import io.qdrant.client.grpc.Common.RepeatedStrings;
import io.qdrant.client.grpc.Common.SliceCondition;
import io.qdrant.client.grpc.Common.ValuesCount;
import java.util.List;

Expand Down Expand Up @@ -142,6 +143,25 @@ public static Condition matchTextAny(String field, String textAny) {
.build();
}

/**
* Match records where the given field starts with the given keyword prefix.
*
* <p>The field must have a keyword index with prefix matching enabled.
*
* @param field The name of the field
* @param prefix The keyword prefix to match
* @return a new instance of {@link Condition}
*/
public static Condition matchPrefix(String field, String prefix) {
return Condition.newBuilder()
.setField(
FieldCondition.newBuilder()
.setKey(field)
.setMatch(Match.newBuilder().setPrefix(prefix).build())
.build())
.build();
}

/**
* Match records where the given field matches the given boolean value.
*
Expand Down Expand Up @@ -427,6 +447,19 @@ public static Condition datetimeRange(String field, DatetimeRange datetimeRange)
.build();
}

/**
* Selects one deterministic slice of the point ID space.
*
* @param total The total number of disjoint slices. Must be at least 1
* @param index The slice to select. Must be less than {@code total}
* @return a new instance of {@link Condition}
*/
public static Condition slice(int total, int index) {
return Condition.newBuilder()
.setSlice(SliceCondition.newBuilder().setTotal(total).setIndex(index).build())
.build();
}

/**
* Matches records where a value for the given vector is present.
*
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/io/qdrant/client/StemmingAlgorithmFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.qdrant.client;

import io.qdrant.client.grpc.Collections.DisabledStemmer;
import io.qdrant.client.grpc.Collections.SnowballParams;
import io.qdrant.client.grpc.Collections.StemmingAlgorithm;

/** Convenience methods for constructing {@link StemmingAlgorithm}. */
public final class StemmingAlgorithmFactory {
private StemmingAlgorithmFactory() {}

/**
* Creates a Snowball stemming algorithm for the given language.
*
* @param language The language whose words should be stemmed
* @return a new instance of {@link StemmingAlgorithm}
*/
public static StemmingAlgorithm snowball(String language) {
return StemmingAlgorithm.newBuilder()
.setSnowball(SnowballParams.newBuilder().setLanguage(language).build())
.build();
}

/**
* Explicitly disables stemming, overriding the language default.
*
* @return a new instance of {@link StemmingAlgorithm}
*/
public static StemmingAlgorithm disabled() {
return StemmingAlgorithm.newBuilder().setDisabled(DisabledStemmer.getDefaultInstance()).build();
}
}
Loading