// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "blueprint.h" #include #include namespace search::fef { class TermFieldMatchData; } namespace search::queryeval { class WeightedSetTermBlueprint : public ComplexLeafBlueprint { fef::MatchDataLayout _layout; FieldSpec _children_field; std::vector _weights; std::vector _terms; public: explicit WeightedSetTermBlueprint(const FieldSpec &field); WeightedSetTermBlueprint(const WeightedSetTermBlueprint &) = delete; WeightedSetTermBlueprint &operator=(const WeightedSetTermBlueprint &) = delete; ~WeightedSetTermBlueprint() override; // used by create visitor // matches signature in dot product blueprint for common blueprint // building code. Hands out the same field spec to all children. FieldSpecBase getNextChildField(FieldSpecBase) { return _children_field; } // used by create visitor void reserve(size_t num_children); void addTerm(Blueprint::UP term, int32_t weight, HitEstimate & estimate); void complete(HitEstimate estimate) { setEstimate(estimate); } void sort(InFlow in_flow, const Options &opts) override; FlowStats calculate_flow_stats(uint32_t docid_limit) const override; SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda) const override; SearchIteratorUP createFilterSearch(FilterConstraint constraint) const override; std::unique_ptr create_matching_elements_search(const MatchingElementsFields &fields) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; private: void fetchPostings(const ExecuteInfo &execInfo) override; }; }