summaryrefslogtreecommitdiffstats
path: root/container-search/src/main
diff options
context:
space:
mode:
authorArne H Juul <arnej27959@users.noreply.github.com>2024-03-22 13:26:19 +0100
committerGitHub <noreply@github.com>2024-03-22 13:26:19 +0100
commit02fad9838f6f83990ee32fedce5aaf193ddb05de (patch)
tree03751f18c4d996a77d0f9b5ab74248228e55a486 /container-search/src/main
parent61c8b4c69ac6d1f96b23e5f299960cefa530c25f (diff)
Revert "fold AND and SAND items into top-level WEAKAND"
Diffstat (limited to 'container-search/src/main')
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java22
1 files changed, 1 insertions, 21 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 692269a1412..43bd175b348 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
@@ -11,7 +11,6 @@ import com.yahoo.prelude.query.OrItem;
import com.yahoo.prelude.query.PhraseItem;
import com.yahoo.prelude.query.QueryCanonicalizer;
import com.yahoo.prelude.query.RankItem;
-import com.yahoo.prelude.query.SegmentItem;
import com.yahoo.prelude.query.TrueItem;
import com.yahoo.prelude.query.WeakAndItem;
import com.yahoo.search.query.QueryTree;
@@ -99,29 +98,10 @@ public class AllParser extends SimpleParser {
return root.getRoot() instanceof NullItem ? null : root.getRoot();
}
- private boolean foldIntoAnd(CompositeItem other) {
- if (other instanceof AndItem) {
- return true;
- }
- if (weakAnd && other instanceof SegmentItem) {
- return true;
- }
- if (weakAnd && other instanceof PhraseItem phrase) {
- return ! phrase.isExplicit();
- }
- return false;
- }
-
protected CompositeItem addAnd(Item item, CompositeItem and) {
if (and == null)
and = createAnd();
- if (item instanceof CompositeItem composite && foldIntoAnd(composite)) {
- for (var subItem : composite.items()) {
- addAnd(subItem, and);
- }
- } else {
- and.addItem(item);
- }
+ and.addItem(item);
return and;
}