diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/ai/vespa/client/dsl/Query.java | 1 | ||||
-rw-r--r-- | client/src/main/java/ai/vespa/client/dsl/UserInput.java | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/client/src/main/java/ai/vespa/client/dsl/Query.java b/client/src/main/java/ai/vespa/client/dsl/Query.java index 36718ced814..118749b083c 100644 --- a/client/src/main/java/ai/vespa/client/dsl/Query.java +++ b/client/src/main/java/ai/vespa/client/dsl/Query.java @@ -13,7 +13,6 @@ public class Query extends QueryChain { final List<QueryChain> queries = new ArrayList<>(); private Annotation annotation; - private Sources sources; Query(Sources sources, QueryChain queryChain) { this.sources = sources; diff --git a/client/src/main/java/ai/vespa/client/dsl/UserInput.java b/client/src/main/java/ai/vespa/client/dsl/UserInput.java index de048c57574..66f7da5d059 100644 --- a/client/src/main/java/ai/vespa/client/dsl/UserInput.java +++ b/client/src/main/java/ai/vespa/client/dsl/UserInput.java @@ -3,7 +3,7 @@ package ai.vespa.client.dsl; import java.util.UUID; -public class UserInput extends QueryChain { +public class UserInput extends Query { private final Annotation annotation; // accept only defaultIndex annotation private final String value; @@ -16,7 +16,7 @@ public class UserInput extends QueryChain { } UserInput(Sources sources, Annotation annotation, String value) { - this.sources = sources; + super(sources); this.annotation = annotation; this.value = value; this.valueIsReference = value.startsWith("@"); @@ -56,22 +56,26 @@ public class UserInput extends QueryChain { } @Override - boolean hasPositiveSearchField(String fieldName) { + public boolean hasPositiveSearchField(String fieldName) { + if (super.hasPositiveSearchField(fieldName)) return true; return !"andnot".equals(this.op) && this.indexField.equals(fieldName); } @Override - boolean hasPositiveSearchField(String fieldName, Object value) { + public boolean hasPositiveSearchField(String fieldName, Object value) { + if (super.hasPositiveSearchField(fieldName, value)) return true; return hasPositiveSearchField(fieldName) && this.value.equals(value); } @Override - boolean hasNegativeSearchField(String fieldName) { + public boolean hasNegativeSearchField(String fieldName) { + if (super.hasNegativeSearchField(fieldName)) return true; return "andnot".equals(this.op) && this.indexField.equals(fieldName); } @Override - boolean hasNegativeSearchField(String fieldName, Object value) { + public boolean hasNegativeSearchField(String fieldName, Object value) { + if (super.hasNegativeSearchField(fieldName, value)) return true; return hasNegativeSearchField(fieldName) && this.value.equals(value); } |