summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-03-15 21:23:02 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-03-18 15:26:01 +0000
commit1f1c004f0cf08d3c578acec2f3f409afab3f498d (patch)
tree16239322556964daad30458227a0fe0c41b9a5c2 /searchcore
parent619a5646f8a9a35f6bf777ea2d0b1e73f17567b4 (diff)
Rank and AndNot are the same.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/query.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp
index ae9832eaa56..6ce77bfd738 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp
@@ -45,9 +45,9 @@ Node::UP
inject(Node::UP query, Node::UP to_inject) {
if (dynamic_cast<search::query::And *>(query.get())) {
dynamic_cast<search::query::And &>(*query).append(std::move(to_inject));
- } else if (dynamic_cast<search::query::Rank *>(query.get())) {
- search::query::Rank & rank = dynamic_cast<search::query::Rank &>(*query);
- rank.prepend(inject(rank.stealFirst(), std::move(to_inject)));
+ } else if (dynamic_cast<search::query::Rank *>(query.get()) || dynamic_cast<search::query::AndNot *>(query.get())) {
+ search::query::Intermediate & root = dynamic_cast<search::query::Intermediate &>(*query);
+ root.prepend(inject(root.stealFirst(), std::move(to_inject)));
} else {
auto new_root = std::make_unique<ProtonAnd>();
new_root->append(std::move(query));