aboutsummaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-10-20 13:46:20 +0200
committerJon Bratseth <bratseth@gmail.com>2021-10-20 13:46:20 +0200
commita5a04ef8ee2f7315971e2603cf5285cba7e20186 (patch)
treef24deb2eacf20b526bbd229aa598585a1c748c00 /client/src
parente5573dc7279c54cefe47cc5eb450ff9018196145 (diff)
WeakAnd has no field
Diffstat (limited to 'client/src')
-rw-r--r--client/src/main/java/ai/vespa/client/dsl/Text.java6
-rw-r--r--client/src/main/java/ai/vespa/client/dsl/WeakAnd.java8
-rw-r--r--client/src/test/groovy/ai/vespa/client/dsl/QTest.groovy2
3 files changed, 9 insertions, 7 deletions
diff --git a/client/src/main/java/ai/vespa/client/dsl/Text.java b/client/src/main/java/ai/vespa/client/dsl/Text.java
index aca43d40b6a..34931b78d2f 100644
--- a/client/src/main/java/ai/vespa/client/dsl/Text.java
+++ b/client/src/main/java/ai/vespa/client/dsl/Text.java
@@ -1,15 +1,17 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
package ai.vespa.client.dsl;
import java.util.Locale;
/**
* Text utility functions.
+ *
* @author arnej
- **/
+ */
final class Text {
+
public static String format(String format, Object... args) {
return String.format(Locale.US, format, args);
}
+
}
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 3059e4adea1..04e1abc9f49 100644
--- a/client/src/main/java/ai/vespa/client/dsl/WeakAnd.java
+++ b/client/src/main/java/ai/vespa/client/dsl/WeakAnd.java
@@ -5,9 +5,9 @@ import java.util.stream.Collectors;
public class WeakAnd extends QueryChain {
- private String fieldName;
+ private final String fieldName;
private Annotation annotation;
- private Query value;
+ private final Query value;
WeakAnd(String fieldName, Query value) {
@@ -55,8 +55,8 @@ public class WeakAnd extends QueryChain {
boolean hasAnnotation = A.hasAnnotation(annotation);
String
s =
- Text.format("weakAnd(%s, %s)", fieldName,
- value.queries.stream().map(Object::toString).collect(Collectors.joining(", ")));
+ Text.format("weakAnd(%s)",
+ value.queries.stream().map(Object::toString).collect(Collectors.joining(", ")));
return hasAnnotation ? Text.format("([%s]%s)", annotation, s) : s;
}
}
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 1bada4e8f59..0e7eda3c1b9 100644
--- a/client/src/test/groovy/ai/vespa/client/dsl/QTest.groovy
+++ b/client/src/test/groovy/ai/vespa/client/dsl/QTest.groovy
@@ -241,7 +241,7 @@ class QTest extends Specification {
.build()
expect:
- q == """yql=select * from sd1 where weakAnd(f1, f1 contains "v1", f2 contains "v2") and ([{"scoreThreshold":0.13}]weakAnd(f3, f1 contains "v1", f2 contains "v2"));"""
+ q == """yql=select * from sd1 where weakAnd(f1 contains "v1", f2 contains "v2") and ([{"scoreThreshold":0.13}]weakAnd(f1 contains "v1", f2 contains "v2"));"""
}
def "geo location"() {