// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "multi_numeric_flag_search_context.h" #include "attributeiterators.hpp" #include "attributevector.h" #include #include #include #include namespace search::attribute { using queryeval::SearchIterator; template MultiNumericFlagSearchContext::MultiNumericFlagSearchContext(std::unique_ptr qTerm, const AttributeVector& toBeSearched, MultiValueMappingReadView mv_mapping_read_view, AtomicBitVectorsRef bit_vectors) : MultiNumericSearchContext(std::move(qTerm), toBeSearched, mv_mapping_read_view), _bit_vectors(bit_vectors), _zeroHits(false) { } template std::unique_ptr MultiNumericFlagSearchContext::createIterator(fef::TermFieldMatchData* matchData, bool strict) { if (this->valid()) { if (this->_low == this->_high) { const AttributeVector & attr = this->attribute(); const BitVector * bv(get_bit_vector(this->_low)); if (bv != nullptr) { return BitVectorIterator::create(bv, attr.getCommittedDocIdLimit(), *matchData, strict); } else { return std::make_unique(); } } else { SearchIterator::UP flagIterator( strict ? new FlagAttributeIteratorStrict(*this, matchData) : new FlagAttributeIteratorT(*this, matchData)); return flagIterator; } } else { return std::make_unique(); } } template class MultiNumericFlagSearchContext; }