diff options
-rw-r--r-- | searchcore/src/tests/proton/matching/query_test.cpp | 4 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/sameelementmodifier.cpp | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/searchcore/src/tests/proton/matching/query_test.cpp b/searchcore/src/tests/proton/matching/query_test.cpp index 461d2300843..9adb86147b6 100644 --- a/searchcore/src/tests/proton/matching/query_test.cpp +++ b/searchcore/src/tests/proton/matching/query_test.cpp @@ -911,8 +911,8 @@ Test::requireThatSameElementTermsAreProperlyPrefixed() root = dynamic_cast<search::query::SameElement *>(query.get()); EXPECT_EQUAL(root->getView(), "abc"); EXPECT_EQUAL(root->getChildren().size(), 2u); - EXPECT_EQUAL(dynamic_cast<ProtonStringTerm *>(root->getChildren()[0])->getView(), "abc.f1"); - EXPECT_EQUAL(dynamic_cast<ProtonStringTerm *>(root->getChildren()[1])->getView(), "abc.f2"); + EXPECT_EQUAL(dynamic_cast<ProtonStringTerm *>(root->getChildren()[0])->getView(), "abc.abc.f1"); + EXPECT_EQUAL(dynamic_cast<ProtonStringTerm *>(root->getChildren()[1])->getView(), "abc.abc.f2"); } Test::~Test() = default; diff --git a/searchcore/src/vespa/searchcore/proton/matching/sameelementmodifier.cpp b/searchcore/src/vespa/searchcore/proton/matching/sameelementmodifier.cpp index 55462d6cdf8..da33d444d99 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/sameelementmodifier.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/sameelementmodifier.cpp @@ -15,10 +15,7 @@ SameElementModifier::visit(ProtonNodeTypes::SameElement &n) { for (search::query::Node * child : n.getChildren()) { search::query::TermNode * term = dynamic_cast<search::query::TermNode *>(child); if (term != nullptr) { - const vespalib::string & index = term->getView(); - if (index.find(prefix) != 0) { // This can be removed when qrs does not prefix the sameelemnt children - term->setView(prefix + index); - } + term->setView(prefix + term->getView()); } else { LOG(error, "Required a search::query::TermNode. Got %s", vespalib::getClassName(*child).c_str()); } |