// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "multisearch.h" #include #include #include #include #include #include namespace search::fef { class TermFieldMatchData; } namespace search::queryeval { class Blueprint; /** * Search iterator for a weighted set, based on a set of child search * iterators. */ class WeightedSetTermSearch : public SearchIterator { protected: WeightedSetTermSearch() = default; public: // TODO: pass ownership with unique_ptr static SearchIterator::UP create(const std::vector &children, search::fef::TermFieldMatchData &tmd, bool field_is_filter, const std::vector &weights, fef::MatchData::UP match_data); static SearchIterator::UP create(search::fef::TermFieldMatchData &tmd, bool field_is_filter, const std::vector &weights, std::vector &&iterators); // used during docsum fetching to identify matching elements // initRange must be called before use. // doSeek/doUnpack must not be called. virtual void find_matching_elements(uint32_t docid, const std::vector> &child_blueprints, std::vector &dst) = 0; }; }