aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-06-09 15:00:48 +0200
committerJon Bratseth <bratseth@gmail.com>2022-06-09 15:00:48 +0200
commit0b1da738e231afe80c6d7fe76f2cf47efca70071 (patch)
treec5ab6ff7942f958361fa201aca6dbf994e7fcd0d /container-search/src/main/java/com/yahoo
parent4538fa9c4075cb3c39f61246e2e9606b73a9a9f1 (diff)
Change user query default from ALL to WEAKAND on Vespa 8
Diffstat (limited to 'container-search/src/main/java/com/yahoo')
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java1
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/query/parser/SimpleParser.java1
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/Model.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/yql/YqlParser.java4
4 files changed, 3 insertions, 5 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java b/container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java
index 80a2320b039..8cc820d8f76 100644
--- a/container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java
+++ b/container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java
@@ -55,7 +55,6 @@ public class AllParser extends SimpleParser {
CompositeItem and = null;
NotItem not = null; // Store negatives here as we go
Item current;
-
// Find all items
do {
current = negativeItem();
diff --git a/container-search/src/main/java/com/yahoo/prelude/query/parser/SimpleParser.java b/container-search/src/main/java/com/yahoo/prelude/query/parser/SimpleParser.java
index 020d93d951c..27bce6bd027 100644
--- a/container-search/src/main/java/com/yahoo/prelude/query/parser/SimpleParser.java
+++ b/container-search/src/main/java/com/yahoo/prelude/query/parser/SimpleParser.java
@@ -51,7 +51,6 @@ abstract class SimpleParser extends StructuredParser {
Item topLevelItem = null;
NotItem not = null;
Item item = null;
-
do {
item = positiveItem();
if (item != null) {
diff --git a/container-search/src/main/java/com/yahoo/search/query/Model.java b/container-search/src/main/java/com/yahoo/search/query/Model.java
index 1b12f3f3bb8..dbaab3045bf 100644
--- a/container-search/src/main/java/com/yahoo/search/query/Model.java
+++ b/container-search/src/main/java/com/yahoo/search/query/Model.java
@@ -86,7 +86,7 @@ public class Model implements Cloneable {
private Locale locale = null;
private QueryTree queryTree = null; // The query tree to execute. This is lazily created from the program
private String defaultIndex = null;
- private Query.Type type = Query.Type.ALL;
+ private Query.Type type = Query.Type.WEAKAND;
private Query parent;
private Set<String> sources = new LinkedHashSet<>();
private Set<String> restrict = new LinkedHashSet<>();
diff --git a/container-search/src/main/java/com/yahoo/search/yql/YqlParser.java b/container-search/src/main/java/com/yahoo/search/yql/YqlParser.java
index 15e3b7aab14..a149ae9323a 100644
--- a/container-search/src/main/java/com/yahoo/search/yql/YqlParser.java
+++ b/container-search/src/main/java/com/yahoo/search/yql/YqlParser.java
@@ -740,7 +740,7 @@ public class YqlParser implements Parser {
if (allowEmpty && (wordData == null || wordData.isEmpty())) return new NullItem();
String grammar = getAnnotation(ast, USER_INPUT_GRAMMAR, String.class,
- Query.Type.ALL.toString(), "grammar for handling user input");
+ Query.Type.WEAKAND.toString(), "grammar for handling user input");
String defaultIndex = getAnnotation(ast, USER_INPUT_DEFAULT_INDEX,
String.class, "default", "default index for user input terms");
Language language = decideParsingLanguage(ast, wordData);
@@ -1448,7 +1448,7 @@ public class YqlParser implements Parser {
"setting for whether to use substring match of input data");
boolean exact = exactMatch != null ? exactMatch : indexFactsSession.getIndex(indexNameExpander.expand(field)).isExact();
String grammar = getAnnotation(ast, USER_INPUT_GRAMMAR, String.class,
- Query.Type.ALL.toString(), "grammar for handling word input");
+ Query.Type.WEAKAND.toString(), "grammar for handling word input");
Preconditions.checkArgument((prefixMatch ? 1 : 0) +
(substrMatch ? 1 : 0) + (suffixMatch ? 1 : 0) < 2,
"Only one of prefix, substring and suffix can be set.");