Skip to content

Commit 7152e24

Browse files
committed
1.19.0
1 parent e50da94 commit 7152e24

5 files changed

Lines changed: 71 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ To install the library, add the following lines to your build config file.
3838
<dependency>
3939
<groupId>io.qdrant</groupId>
4040
<artifactId>client</artifactId>
41-
<version>1.18.3</version>
41+
<version>1.19.0</version>
4242
</dependency>
4343
```
4444

4545
#### SBT
4646

4747
```sbt
48-
libraryDependencies += "io.qdrant" % "client" % "1.18.3"
48+
libraryDependencies += "io.qdrant" % "client" % "1.19.0"
4949
```
5050

5151
#### Gradle
5252

5353
```gradle
54-
implementation 'io.qdrant:client:1.18.3'
54+
implementation 'io.qdrant:client:1.19.0'
5555
```
5656

5757
> [!NOTE]

example/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repositories {
1313

1414
dependencies {
1515
// Qdrant Java client
16-
implementation 'io.qdrant:client:1.18.3'
16+
implementation 'io.qdrant:client:1.19.0'
1717

1818
// gRPC dependencies - use the same version as Qdrant client
1919
implementation 'io.grpc:grpc-netty-shaded:1.65.1'

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# The version of qdrant to use to download protos
2-
qdrantProtosVersion=v1.18.0
2+
qdrantProtosVersion=dev
33

44
# The version of qdrant docker image to run integration tests against
5-
qdrantVersion=v1.18.0
5+
qdrantVersion=dev
66

77
# The version of the client to generate
8-
packageVersion=1.18.3
8+
packageVersion=1.19.0

src/main/java/io/qdrant/client/ConditionFactory.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import io.qdrant.client.grpc.Common.Range;
2020
import io.qdrant.client.grpc.Common.RepeatedIntegers;
2121
import io.qdrant.client.grpc.Common.RepeatedStrings;
22+
import io.qdrant.client.grpc.Common.SliceCondition;
2223
import io.qdrant.client.grpc.Common.ValuesCount;
2324
import java.util.List;
2425

@@ -142,6 +143,25 @@ public static Condition matchTextAny(String field, String textAny) {
142143
.build();
143144
}
144145

146+
/**
147+
* Match records where the given field starts with the given keyword prefix.
148+
*
149+
* <p>The field must have a keyword index with prefix matching enabled.
150+
*
151+
* @param field The name of the field
152+
* @param prefix The keyword prefix to match
153+
* @return a new instance of {@link Condition}
154+
*/
155+
public static Condition matchPrefix(String field, String prefix) {
156+
return Condition.newBuilder()
157+
.setField(
158+
FieldCondition.newBuilder()
159+
.setKey(field)
160+
.setMatch(Match.newBuilder().setPrefix(prefix).build())
161+
.build())
162+
.build();
163+
}
164+
145165
/**
146166
* Match records where the given field matches the given boolean value.
147167
*
@@ -427,6 +447,19 @@ public static Condition datetimeRange(String field, DatetimeRange datetimeRange)
427447
.build();
428448
}
429449

450+
/**
451+
* Selects one deterministic slice of the point ID space.
452+
*
453+
* @param total The total number of disjoint slices. Must be at least 1
454+
* @param index The slice to select. Must be less than {@code total}
455+
* @return a new instance of {@link Condition}
456+
*/
457+
public static Condition slice(int total, int index) {
458+
return Condition.newBuilder()
459+
.setSlice(SliceCondition.newBuilder().setTotal(total).setIndex(index).build())
460+
.build();
461+
}
462+
430463
/**
431464
* Matches records where a value for the given vector is present.
432465
*
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package io.qdrant.client;
2+
3+
import io.qdrant.client.grpc.Collections.DisabledStemmer;
4+
import io.qdrant.client.grpc.Collections.SnowballParams;
5+
import io.qdrant.client.grpc.Collections.StemmingAlgorithm;
6+
7+
/** Convenience methods for constructing {@link StemmingAlgorithm}. */
8+
public final class StemmingAlgorithmFactory {
9+
private StemmingAlgorithmFactory() {}
10+
11+
/**
12+
* Creates a Snowball stemming algorithm for the given language.
13+
*
14+
* @param language The language whose words should be stemmed
15+
* @return a new instance of {@link StemmingAlgorithm}
16+
*/
17+
public static StemmingAlgorithm snowball(String language) {
18+
return StemmingAlgorithm.newBuilder()
19+
.setSnowball(SnowballParams.newBuilder().setLanguage(language).build())
20+
.build();
21+
}
22+
23+
/**
24+
* Explicitly disables stemming, overriding the language default.
25+
*
26+
* @return a new instance of {@link StemmingAlgorithm}
27+
*/
28+
public static StemmingAlgorithm disabled() {
29+
return StemmingAlgorithm.newBuilder().setDisabled(DisabledStemmer.getDefaultInstance()).build();
30+
}
31+
}

0 commit comments

Comments
 (0)