summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-10-20 20:51:03 +0200
committerJon Bratseth <bratseth@gmail.com>2021-10-20 20:51:03 +0200
commit23d17b88d0aeda62e4621f80dfe65b1924278aa3 (patch)
tree9eb364130ff4e532b4f71b91289ac21860c54422 /client
parenta5a04ef8ee2f7315971e2603cf5285cba7e20186 (diff)
Remove unnecessary field
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/ai/vespa/client/dsl/Q.java11
-rw-r--r--client/src/main/java/ai/vespa/client/dsl/WeakAnd.java5
-rw-r--r--client/src/test/groovy/ai/vespa/client/dsl/QTest.groovy4
3 files changed, 11 insertions, 9 deletions
diff --git a/client/src/main/java/ai/vespa/client/dsl/Q.java b/client/src/main/java/ai/vespa/client/dsl/Q.java
index 32b79c84458..a709ec826fc 100644
--- a/client/src/main/java/ai/vespa/client/dsl/Q.java
+++ b/client/src/main/java/ai/vespa/client/dsl/Q.java
@@ -162,12 +162,17 @@ public final class Q {
* Weakand weak and.
* https://docs.vespa.ai/en/reference/query-language-reference.html#weakand
*
- * @param field the field
* @param query the query
* @return the weak and query
*/
- public static WeakAnd weakand(String field, Query query) {
- return new WeakAnd(field, query);
+ public static WeakAnd weakand(Query query) {
+ return new WeakAnd(query);
+ }
+
+ /** @deprecated use weakand(query) */
+ @Deprecated // Remove on Vespa 8
+ public static WeakAnd weakand(String ignored, Query query) {
+ return new WeakAnd(query);
}
/**
diff --git a/client/src/main/java/ai/vespa/client/dsl/WeakAnd.java b/client/src/main/java/ai/vespa/client/dsl/WeakAnd.java
index 04e1abc9f49..cbd796a6ad5 100644
--- a/client/src/main/java/ai/vespa/client/dsl/WeakAnd.java
+++ b/client/src/main/java/ai/vespa/client/dsl/WeakAnd.java
@@ -5,13 +5,10 @@ import java.util.stream.Collectors;
public class WeakAnd extends QueryChain {
- private final String fieldName;
private Annotation annotation;
private final Query value;
-
- WeakAnd(String fieldName, Query value) {
- this.fieldName = fieldName;
+ WeakAnd(Query value) {
this.value = value;
this.nonEmpty = true;
}
diff --git a/client/src/test/groovy/ai/vespa/client/dsl/QTest.groovy b/client/src/test/groovy/ai/vespa/client/dsl/QTest.groovy
index 0e7eda3c1b9..1040202f761 100644
--- a/client/src/test/groovy/ai/vespa/client/dsl/QTest.groovy
+++ b/client/src/test/groovy/ai/vespa/client/dsl/QTest.groovy
@@ -233,8 +233,8 @@ class QTest extends Specification {
given:
def q = Q.select("*")
.from("sd1")
- .where(Q.weakand("f1", Q.p("f1").contains("v1").and("f2").contains("v2")))
- .and(Q.weakand("f3", Q.p("f1").contains("v1").and("f2").contains("v2"))
+ .where(Q.weakand(Q.p("f1").contains("v1").and("f2").contains("v2")))
+ .and(Q.weakand(Q.p("f1").contains("v1").and("f2").contains("v2"))
.annotate(A.a("scoreThreshold", 0.13))
)
.semicolon()