aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/queryeval/blueprint
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@yahooinc.com>2023-12-18 12:53:50 +0000
committerHåvard Pettersen <havardpe@yahooinc.com>2023-12-18 12:53:50 +0000
commite83f2ba4fb649a31b5a9656dbc471d3caf55ba84 (patch)
treeefc9568b4c31c282511ba65bec7355c002c9515c /searchlib/src/tests/queryeval/blueprint
parentce02fe1d45877ec7543e35d9a87ac65f9f8744e3 (diff)
do nested collapsing of AND when collapsing ANDNOT
this is needed since the AND getting the extra AND as a child has already been processed for the optimize pass that performs AND collapsing.
Diffstat (limited to 'searchlib/src/tests/queryeval/blueprint')
-rw-r--r--searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp b/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp
index e24e91c2f1d..53803c9c9e7 100644
--- a/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp
+++ b/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp
@@ -716,6 +716,22 @@ TEST("AND_NOT AND AND_NOT collapsing") {
optimize_and_compare(std::move(top), std::move(expect));
}
+TEST("AND_NOT AND AND_NOT AND nested collapsing") {
+ Blueprint::UP top = make::ANDNOT()
+ .add(make::AND()
+ .add(make::ANDNOT()
+ .add(make::AND().leafs({1,2}))
+ .leafs({5,6}))
+ .add(make::ANDNOT()
+ .add(make::AND().leafs({3,4}))
+ .leafs({8,9})))
+ .leaf(7);
+ Blueprint::UP expect = make::ANDNOT()
+ .add(make::AND().leafs({1,2,3,4}))
+ .leafs({9,8,7,6,5});
+ optimize_and_compare(std::move(top), std::move(expect));
+}
+
TEST("AND_NOT AND AND_NOT collapsing into full source blender optimization") {
InvalidSelector sel;
Blueprint::UP top =