// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "single_enum_search_context.h" #include "attributeiterators.hpp" #include namespace search::attribute { template SingleEnumSearchContext::SingleEnumSearchContext(typename BaseSC::MatcherType&& matcher, const AttributeVector& toBeSearched, EnumIndices enum_indices, const EnumStoreT& enum_store) : BaseSC(toBeSearched, std::move(matcher)), _enum_indices(enum_indices), _enum_store(enum_store) { } template std::unique_ptr SingleEnumSearchContext::createFilterIterator(fef::TermFieldMatchData* matchData, bool strict) { if (!this->valid()) { return std::make_unique(); } if (this->getIsFilter()) { return strict ? std::make_unique>(*this, matchData) : std::make_unique>(*this, matchData); } return strict ? std::make_unique>(*this, matchData) : std::make_unique>(*this, matchData); } template uint32_t SingleEnumSearchContext::get_committed_docid_limit() const noexcept { return _enum_indices.size(); } }