diff options
author | Geir Storli <geirst@oath.com> | 2018-06-25 11:29:26 +0000 |
---|---|---|
committer | Geir Storli <geirst@oath.com> | 2018-06-25 14:59:15 +0000 |
commit | b39627aadd24b5274c8e793d921354b837fea628 (patch) | |
tree | b2ca2b9aab5ffecbddab06bc93d8af8b5a68e7f9 /searchcore | |
parent | ab61e5ea77c483c0fe4fb6a3f266bd47f590988a (diff) |
Ensure that all attribute iterators expose the search context creating the iterator.
This ensures that also fast-search struct field attributes work together with the sameElement operator.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/documentmetastore/search_context.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/search_context.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/search_context.cpp index e10e6ed539b..5a4c15ed27a 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/search_context.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/search_context.cpp @@ -36,8 +36,9 @@ private: protected: const DocumentMetaStore & _store; public: - GidAllSearchIterator(TermFieldMatchData *matchData, const DocumentMetaStore &store) - : AttributeIteratorBase(matchData), + GidAllSearchIterator(const search::attribute::ISearchContext &baseSearchCtx, + TermFieldMatchData *matchData, const DocumentMetaStore &store) + : AttributeIteratorBase(baseSearchCtx, matchData), _store(store) { } @@ -64,9 +65,10 @@ private: } public: - GidStrictAllSearchIterator(TermFieldMatchData *matchData, + GidStrictAllSearchIterator(const search::attribute::ISearchContext &baseSearchCtx, + TermFieldMatchData *matchData, const DocumentMetaStore &store) - : GidAllSearchIterator(matchData, store), + : GidAllSearchIterator(baseSearchCtx, matchData, store), _numDocs(store.getNumDocs()) { } @@ -88,8 +90,9 @@ private: } } public: - GidSearchIterator(TermFieldMatchData *matchData, const DocumentMetaStore &store, const GlobalId &gid) - : GidAllSearchIterator(matchData, store), + GidSearchIterator(const search::attribute::ISearchContext &baseSearchCtx, + TermFieldMatchData *matchData, const DocumentMetaStore &store, const GlobalId &gid) + : GidAllSearchIterator(baseSearchCtx, matchData, store), _gid(gid) { } @@ -119,10 +122,10 @@ SearchIterator::UP SearchContext::createIterator(TermFieldMatchData *matchData, bool strict) { return _isWord - ? std::make_unique<GidSearchIterator>(matchData, getStore(), _gid) + ? std::make_unique<GidSearchIterator>(*this, matchData, getStore(), _gid) : strict - ? std::make_unique<GidStrictAllSearchIterator>(matchData, getStore()) - : std::make_unique<GidAllSearchIterator>(matchData, getStore()); + ? std::make_unique<GidStrictAllSearchIterator>(*this, matchData, getStore()) + : std::make_unique<GidAllSearchIterator>(*this, matchData, getStore()); } const DocumentMetaStore & |