diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-10 10:03:32 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-10 10:03:32 +0000 |
commit | 373acb16527ab02cadd4142fb0b6b2cc14a3ae6d (patch) | |
tree | d3e5ac3a2ed0aaf6b662b272a1fa076535147964 | |
parent | d839b8a1652ceecf091c41fcb9f4041fc5259d81 (diff) |
Only provide a filter iterator if that is all that is needed.
3 files changed, 10 insertions, 3 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp index 9e3b0bbde3e..7ae55a243f8 100644 --- a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp @@ -3,7 +3,6 @@ #include "imported_attribute_vector.h" #include "imported_attribute_vector_read_guard.h" #include "imported_search_context.h" -#include <vespa/vespalib/util/exceptions.h> namespace search::attribute { diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp index f146378782c..0c15e832487 100644 --- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp +++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp @@ -44,9 +44,9 @@ ImportedSearchContext::ImportedSearchContext( _target_search_context(_target_attribute.createSearchContext(std::move(term), params)), _targetLids(_reference_attribute.getTargetLids()), _merger(_reference_attribute.getCommittedDocIdLimit()), - _fetchPostingsDone(false) + _fetchPostingsDone(false), + _params(params) { - } ImportedSearchContext::~ImportedSearchContext() = default; @@ -74,6 +74,13 @@ ImportedSearchContext::createIterator(fef::TermFieldMatchData* matchData, bool s } else if (_merger.hasBitVector()) { return BitVectorIterator::create(_merger.getBitVector(), _merger.getDocIdLimit(), *matchData, strict); } + if (_params.useBitVector()) { + if (!strict) { + return std::make_unique<FilterAttributeIteratorT<ImportedSearchContext>>(*this, matchData); + } else { + return std::make_unique<FilterAttributeIteratorStrict<ImportedSearchContext>>(*this, matchData); + } + } if (!strict) { return std::make_unique<AttributeIteratorT<ImportedSearchContext>>(*this, matchData); } else { diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.h b/searchlib/src/vespa/searchlib/attribute/imported_search_context.h index 2663978c99a..1c73ac6c8c2 100644 --- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.h +++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.h @@ -38,6 +38,7 @@ class ImportedSearchContext : public ISearchContext { TargetLids _targetLids; PostingListMerger<int32_t> _merger; bool _fetchPostingsDone; + SearchContextParams _params; uint32_t getTargetLid(uint32_t lid) const { return _targetLids[lid]; |