aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-05-30 14:47:47 +0000
committerArne Juul <arnej@yahoo-inc.com>2018-05-30 14:47:47 +0000
commit4c155ecbf83b8fcc3b1b7ba3836844d321788614 (patch)
tree31d91e51a31874a252bf58a816894da08ca66798 /searchlib
parente7612b41e24801958193c09648f1f5ecfecb03a3 (diff)
wrap attribute iterators with an elementiterator
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp
index a563a288396..46017658a93 100644
--- a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp
@@ -3,6 +3,7 @@
#include "same_element_blueprint.h"
#include "same_element_search.h"
#include <vespa/searchlib/fef/termfieldmatchdata.h>
+#include <vespa/searchlib/attribute/elementiterator.h>
#include <vespa/vespalib/objects/visit.hpp>
#include <algorithm>
#include <map>
@@ -67,7 +68,13 @@ SameElementBlueprint::createLeafSearch(const search::fef::TermFieldMatchDataArra
const State &childState = _terms[i]->getState();
assert(childState.numFields() == 1);
childMatch.add(childState.field(0).resolve(*md));
- children[i] = _terms[i]->createSearch(*md, (strict && (i == 0)));
+ SearchIterator::UP child = _terms[i]->createSearch(*md, (strict && (i == 0)));
+ const attribute::ISearchContext *context = child->getAttributeSearchContext();
+ if (context == nullptr) {
+ children[i] = std::move(child);
+ } else {
+ children[i] = std::make_unique<attribute::ElementIterator>(std::move(child), *context, *childMatch[i]);
+ }
}
return std::make_unique<SameElementSearch>(std::move(md), std::move(children), childMatch, strict);
}