Skip to content

Commit b08ce94

Browse files
Anush008timvisee
andauthored
v1.14.0 (#68)
* 1-14-0 Signed-off-by: Anush008 <[email protected]> * docs: Removed license year README.md * docs: Bump version README.md * Use Qdrant version v1.14.0 Co-authored-by: Anush <[email protected]> --------- Signed-off-by: Anush008 <[email protected]> Co-authored-by: Tim Visée <[email protected]>
1 parent cf17b88 commit b08ce94

File tree

5 files changed

+223
-10
lines changed

5 files changed

+223
-10
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ To install the library, add the following lines to your build config file.
3434
<dependency>
3535
<groupId>io.qdrant</groupId>
3636
<artifactId>client</artifactId>
37-
<version>1.13.0</version>
37+
<version>1.14.0</version>
3838
</dependency>
3939
```
4040

4141
#### SBT
4242

4343
```sbt
44-
libraryDependencies += "io.qdrant" % "client" % "1.13.0"
44+
libraryDependencies += "io.qdrant" % "client" % "1.14.0"
4545
```
4646

4747
#### Gradle
4848

4949
```gradle
50-
implementation 'io.qdrant:client:1.13.0'
50+
implementation 'io.qdrant:client:1.14.0'
5151
```
5252

5353
> [!NOTE]
@@ -188,4 +188,4 @@ List<ScoredPoint> points = client.searchAsync(SearchPoints.newBuilder()
188188

189189
## ⚖️ LICENSE
190190

191-
Apache 2.0 © [2024](https://github.com/qdrant/java-client/blob/master/LICENSE)
191+
[Apache 2.0](https://github.com/qdrant/java-client/blob/master/LICENSE)

gradle.properties

+3-3
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.13.0
2+
qdrantProtosVersion=v1.14.0
33

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

77
# The version of the client to generate
8-
packageVersion=1.13.0
8+
packageVersion=1.14.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
package io.qdrant.client;
2+
3+
import io.qdrant.client.grpc.Points.Condition;
4+
import io.qdrant.client.grpc.Points.DecayParamsExpression;
5+
import io.qdrant.client.grpc.Points.DivExpression;
6+
import io.qdrant.client.grpc.Points.Expression;
7+
import io.qdrant.client.grpc.Points.GeoDistance;
8+
import io.qdrant.client.grpc.Points.MultExpression;
9+
import io.qdrant.client.grpc.Points.PowExpression;
10+
import io.qdrant.client.grpc.Points.SumExpression;
11+
12+
/** Convenience methods for constructing {@link Expression} */
13+
public final class ExpressionFactory {
14+
private ExpressionFactory() {}
15+
16+
/**
17+
* Creates an {@link Expression} from a constant.
18+
*
19+
* @param constant The constant float value
20+
* @return a new instance of {@link Expression}
21+
*/
22+
public static Expression constant(float constant) {
23+
return Expression.newBuilder().setConstant(constant).build();
24+
}
25+
26+
/**
27+
* Creates an {@link Expression} from a variable name.
28+
*
29+
* @param variable The variable name (e.g., payload key or score reference)
30+
* @return a new instance of {@link Expression}
31+
*/
32+
public static Expression variable(String variable) {
33+
return Expression.newBuilder().setVariable(variable).build();
34+
}
35+
36+
/**
37+
* Creates an {@link Expression} from a {@link Condition}.
38+
*
39+
* @param condition The condition to evaluate
40+
* @return a new instance of {@link Expression}
41+
*/
42+
public static Expression condition(Condition condition) {
43+
return Expression.newBuilder().setCondition(condition).build();
44+
}
45+
46+
/**
47+
* Creates an {@link Expression} from a {@link GeoDistance}.
48+
*
49+
* @param geoDistance The geo distance object
50+
* @return a new instance of {@link Expression}
51+
*/
52+
public static Expression geoDistance(GeoDistance geoDistance) {
53+
return Expression.newBuilder().setGeoDistance(geoDistance).build();
54+
}
55+
56+
/**
57+
* Creates an {@link Expression} from a date-time constant string.
58+
*
59+
* @param datetime The date-time string
60+
* @return a new instance of {@link Expression}
61+
*/
62+
public static Expression datetime(String datetime) {
63+
return Expression.newBuilder().setDatetime(datetime).build();
64+
}
65+
66+
/**
67+
* Creates an {@link Expression} from a payload key referencing date-time values.
68+
*
69+
* @param datetimeKey The payload key containing date-time values
70+
* @return a new instance of {@link Expression}
71+
*/
72+
public static Expression datetimeKey(String datetimeKey) {
73+
return Expression.newBuilder().setDatetimeKey(datetimeKey).build();
74+
}
75+
76+
/**
77+
* Creates an {@link Expression} that multiplies values.
78+
*
79+
* @param mult The multiplication expression
80+
* @return a new instance of {@link Expression}
81+
*/
82+
public static Expression mult(MultExpression mult) {
83+
return Expression.newBuilder().setMult(mult).build();
84+
}
85+
86+
/**
87+
* Creates an {@link Expression} that sums values.
88+
*
89+
* @param sum The summation expression
90+
* @return a new instance of {@link Expression}
91+
*/
92+
public static Expression sum(SumExpression sum) {
93+
return Expression.newBuilder().setSum(sum).build();
94+
}
95+
96+
/**
97+
* Creates an {@link Expression} that divides values.
98+
*
99+
* @param div The division expression
100+
* @return a new instance of {@link Expression}
101+
*/
102+
public static Expression div(DivExpression div) {
103+
return Expression.newBuilder().setDiv(div).build();
104+
}
105+
106+
/**
107+
* Creates a negated {@link Expression}.
108+
*
109+
* @param expr The expression to negate
110+
* @return a new instance of {@link Expression}
111+
*/
112+
public static Expression negate(Expression expr) {
113+
return Expression.newBuilder().setNeg(expr).build();
114+
}
115+
116+
/**
117+
* Creates an {@link Expression} representing absolute value.
118+
*
119+
* @param expr The expression to wrap with abs()
120+
* @return a new instance of {@link Expression}
121+
*/
122+
public static Expression abs(Expression expr) {
123+
return Expression.newBuilder().setAbs(expr).build();
124+
}
125+
126+
/**
127+
* Creates an {@link Expression} representing square root.
128+
*
129+
* @param expr The expression to apply sqrt() to
130+
* @return a new instance of {@link Expression}
131+
*/
132+
public static Expression sqrt(Expression expr) {
133+
return Expression.newBuilder().setSqrt(expr).build();
134+
}
135+
136+
/**
137+
* Creates an {@link Expression} from a {@link PowExpression}.
138+
*
139+
* @param pow The power expression (base and exponent)
140+
* @return a new instance of {@link Expression}
141+
*/
142+
public static Expression pow(PowExpression pow) {
143+
return Expression.newBuilder().setPow(pow).build();
144+
}
145+
146+
/**
147+
* Creates an {@link Expression} representing exponential.
148+
*
149+
* @param expr The expression to apply exponential to
150+
* @return a new instance of {@link Expression}
151+
*/
152+
public static Expression exp(Expression expr) {
153+
return Expression.newBuilder().setExp(expr).build();
154+
}
155+
156+
/**
157+
* Creates an {@link Expression} representing base-10 logarithm.
158+
*
159+
* @param expr The expression to apply log10() to
160+
* @return a new instance of {@link Expression}
161+
*/
162+
public static Expression log10(Expression expr) {
163+
return Expression.newBuilder().setLog10(expr).build();
164+
}
165+
166+
/**
167+
* Creates an {@link Expression} representing natural logarithm.
168+
*
169+
* @param expr The expression to apply natural log to
170+
* @return a new instance of {@link Expression}
171+
*/
172+
public static Expression ln(Expression expr) {
173+
return Expression.newBuilder().setLn(expr).build();
174+
}
175+
176+
/**
177+
* Creates an {@link Expression} representing exponential decay.
178+
*
179+
* @param decay The decay parameters
180+
* @return a new instance of {@link Expression}
181+
*/
182+
public static Expression expDecay(DecayParamsExpression decay) {
183+
return Expression.newBuilder().setExpDecay(decay).build();
184+
}
185+
186+
/**
187+
* Creates an {@link Expression} representing Gaussian decay.
188+
*
189+
* @param decay The decay parameters
190+
* @return a new instance of {@link Expression}
191+
*/
192+
public static Expression gaussDecay(DecayParamsExpression decay) {
193+
return Expression.newBuilder().setGaussDecay(decay).build();
194+
}
195+
196+
/**
197+
* Creates an {@link Expression} representing linear decay.
198+
*
199+
* @param decay The decay parameters
200+
* @return a new instance of {@link Expression}
201+
*/
202+
public static Expression linDecay(DecayParamsExpression decay) {
203+
return Expression.newBuilder().setLinDecay(decay).build();
204+
}
205+
}

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

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import io.qdrant.client.grpc.Points.ContextInput;
77
import io.qdrant.client.grpc.Points.DiscoverInput;
8+
import io.qdrant.client.grpc.Points.Formula;
89
import io.qdrant.client.grpc.Points.Fusion;
910
import io.qdrant.client.grpc.Points.OrderBy;
1011
import io.qdrant.client.grpc.Points.PointId;
@@ -80,6 +81,16 @@ public static Query orderBy(OrderBy orderBy) {
8081
return Query.newBuilder().setOrderBy(orderBy).build();
8182
}
8283

84+
/**
85+
* Creates a {@link Query} for score boosting using an arbitrary formula.
86+
*
87+
* @param formula An instance of {@link Formula}
88+
* @return a new instance of {@link Query}
89+
*/
90+
public static Query formula(Formula formula) {
91+
return Query.newBuilder().setFormula(formula).build();
92+
}
93+
8394
// region Nearest search queries
8495

8596
/**

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

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
import com.google.common.primitives.Floats;
66
import io.qdrant.client.grpc.Points.DenseVector;
7-
import io.qdrant.client.grpc.Points.Document;
8-
import io.qdrant.client.grpc.Points.Image;
9-
import io.qdrant.client.grpc.Points.InferenceObject;
107
import io.qdrant.client.grpc.Points.MultiDenseVector;
118
import io.qdrant.client.grpc.Points.PointId;
129
import io.qdrant.client.grpc.Points.SparseVector;

0 commit comments

Comments
 (0)