From 78edc04eb66fb4335f28d55e48a08beecd0ee56e Mon Sep 17 00:00:00 2001 From: HÃ¥vard Pettersen Date: Mon, 25 Mar 2024 11:59:58 +0000 Subject: use thread_local for blueprint options --- .../tests/queryeval/blueprint/blueprint_test.cpp | 24 +++++++++++ .../blueprint/intermediate_blueprints_test.cpp | 2 +- .../queryeval/filter_search/filter_search_test.cpp | 4 +- .../attribute/attribute_blueprint_factory.cpp | 6 +-- .../attribute/attribute_weighted_set_blueprint.cpp | 2 +- .../attribute/attribute_weighted_set_blueprint.h | 2 +- .../attribute/direct_multi_term_blueprint.h | 2 +- .../src/vespa/searchlib/queryeval/blueprint.cpp | 18 ++++----- .../src/vespa/searchlib/queryeval/blueprint.h | 47 +++++++++++++++++----- .../searchlib/queryeval/dot_product_blueprint.cpp | 4 +- .../searchlib/queryeval/dot_product_blueprint.h | 2 +- .../vespa/searchlib/queryeval/equiv_blueprint.cpp | 4 +- .../vespa/searchlib/queryeval/equiv_blueprint.h | 2 +- .../queryeval/nearest_neighbor_blueprint.cpp | 2 +- .../queryeval/nearest_neighbor_blueprint.h | 2 +- .../searchlib/queryeval/predicate_blueprint.cpp | 2 +- .../searchlib/queryeval/predicate_blueprint.h | 2 +- .../searchlib/queryeval/same_element_blueprint.cpp | 4 +- .../searchlib/queryeval/same_element_blueprint.h | 2 +- .../queryeval/simple_phrase_blueprint.cpp | 4 +- .../searchlib/queryeval/simple_phrase_blueprint.h | 2 +- .../queryeval/wand/parallel_weak_and_blueprint.cpp | 4 +- .../queryeval/wand/parallel_weak_and_blueprint.h | 2 +- .../queryeval/weighted_set_term_blueprint.cpp | 4 +- .../queryeval/weighted_set_term_blueprint.h | 2 +- 25 files changed, 102 insertions(+), 49 deletions(-) diff --git a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp index 266dc6f8652..d556d997206 100644 --- a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp +++ b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp @@ -794,6 +794,30 @@ TEST("Control object sizes") { EXPECT_EQUAL(88u, sizeof(LeafBlueprint)); } +Blueprint::Options make_opts(bool sort_by_cost, bool allow_force_strict, bool keep_order) { + return Blueprint::Options().sort_by_cost(sort_by_cost).allow_force_strict(allow_force_strict).keep_order(keep_order); +} + +void check_opts(bool sort_by_cost, bool allow_force_strict, bool keep_order) { + EXPECT_EQUAL(Blueprint::opt_sort_by_cost(), sort_by_cost); + EXPECT_EQUAL(Blueprint::opt_allow_force_strict(), allow_force_strict); + EXPECT_EQUAL(Blueprint::opt_keep_order(), keep_order); +} + +TEST("Options binding and nesting") { + check_opts(false, false, false); + { + auto opts_guard1 = Blueprint::bind_opts(make_opts(true, true, false)); + check_opts(true, true, false); + { + auto opts_guard2 = Blueprint::bind_opts(make_opts(false, false, true)); + check_opts(false, false, true); + } + check_opts(true, true, false); + } + check_opts(false, false, false); +} + TEST_MAIN() { TEST_DEBUG("lhs.out", "rhs.out"); TEST_RUN_ALL(); diff --git a/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp b/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp index 9338436348b..d3b6a90e5db 100644 --- a/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp +++ b/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp @@ -579,7 +579,7 @@ optimize_and_compare(Blueprint::UP top, Blueprint::UP expect, bool strict = true top->setDocIdLimit(1000); expect->setDocIdLimit(1000); TEST_DO(compare(*top, *expect, false)); - auto opts = Blueprint::Options::default_options().sort_by_cost(sort_by_cost); + auto opts = Blueprint::Options().sort_by_cost(sort_by_cost); top = Blueprint::optimize_and_sort(std::move(top), strict, opts); TEST_DO(compare(*top, *expect, true)); expect = Blueprint::optimize_and_sort(std::move(expect), strict, opts); diff --git a/searchlib/src/tests/queryeval/filter_search/filter_search_test.cpp b/searchlib/src/tests/queryeval/filter_search/filter_search_test.cpp index 5c29c293d82..d40248336cb 100644 --- a/searchlib/src/tests/queryeval/filter_search/filter_search_test.cpp +++ b/searchlib/src/tests/queryeval/filter_search/filter_search_test.cpp @@ -65,9 +65,9 @@ struct LeafProxy : SimpleLeafBlueprint { FlowStats calculate_flow_stats(uint32_t my_docid_limit) const override { return child->calculate_flow_stats(my_docid_limit); } - void sort(InFlow in_flow, const Options &opts) override { + void sort(InFlow in_flow) override { strict(in_flow.strict()); - child->sort(in_flow, opts); + child->sort(in_flow); } SearchIteratorUP createLeafSearch(const TermFieldMatchDataArray &) const override { abort(); } SearchIteratorUP createFilterSearch(Constraint constraint) const override { diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp index 707b98b1cf3..8ffc43928e1 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp @@ -287,7 +287,7 @@ public: bool should_use() const { return _should_use; } - void sort(queryeval::InFlow in_flow, const Options &) override { + void sort(queryeval::InFlow in_flow) override { strict(in_flow.strict()); } queryeval::FlowStats calculate_flow_stats(uint32_t docid_limit) const override { @@ -374,7 +374,7 @@ public: const common::Location &location() const { return _location; } - void sort(queryeval::InFlow in_flow, const Options &) override { + void sort(queryeval::InFlow in_flow) override { strict(in_flow.strict()); } @@ -507,7 +507,7 @@ public: setEstimate(estimate); } - void sort(queryeval::InFlow in_flow, const Options &) override { + void sort(queryeval::InFlow in_flow) override { strict(in_flow.strict()); } diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp index 81a7a06030e..ce9163bbddb 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp @@ -122,7 +122,7 @@ AttributeWeightedSetBlueprint::addToken(std::unique_ptr context, } void -AttributeWeightedSetBlueprint::sort(queryeval::InFlow in_flow, const Options &) +AttributeWeightedSetBlueprint::sort(queryeval::InFlow in_flow) { strict(in_flow.strict()); } diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.h b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.h index 18cfd6ed5ce..bc487bebb9a 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.h +++ b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.h @@ -31,7 +31,7 @@ public: AttributeWeightedSetBlueprint(const queryeval::FieldSpec &field, const IAttributeVector & attr); ~AttributeWeightedSetBlueprint(); void addToken(std::unique_ptr context, int32_t weight); - void sort(queryeval::InFlow in_flow, const Options &opts) override; + void sort(queryeval::InFlow in_flow) override; queryeval::FlowStats calculate_flow_stats(uint32_t docid_limit) const override; queryeval::SearchIterator::UP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda) const override; queryeval::SearchIterator::UP createFilterSearch(FilterConstraint constraint) const override; diff --git a/searchlib/src/vespa/searchlib/attribute/direct_multi_term_blueprint.h b/searchlib/src/vespa/searchlib/attribute/direct_multi_term_blueprint.h index 7dfc7fe3a78..62c06c99bd4 100644 --- a/searchlib/src/vespa/searchlib/attribute/direct_multi_term_blueprint.h +++ b/searchlib/src/vespa/searchlib/attribute/direct_multi_term_blueprint.h @@ -72,7 +72,7 @@ public: setEstimate(estimate); } - void sort(queryeval::InFlow in_flow, const Options &) override { + void sort(queryeval::InFlow in_flow) override { strict(in_flow.strict()); } diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp index 78bcd33fcb4..1d323bf298f 100644 --- a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp @@ -137,23 +137,23 @@ Blueprint::each_node_post_order(const std::function &f) void Blueprint::basic_plan(InFlow in_flow, uint32_t docid_limit) { + auto opts_guard = bind_opts(Options().sort_by_cost(true)); setDocIdLimit(docid_limit); each_node_post_order([docid_limit](Blueprint &bp){ bp.update_flow_stats(docid_limit); }); - auto opts = Options().sort_by_cost(true); - sort(in_flow, opts); + sort(in_flow); } void Blueprint::null_plan(InFlow in_flow, uint32_t docid_limit) { + auto opts_guard = bind_opts(Options().keep_order(true)); setDocIdLimit(docid_limit); each_node_post_order([docid_limit](Blueprint &bp){ bp.update_flow_stats(docid_limit); }); - auto opts = Options().sort_by_cost(true).keep_order(true); - sort(in_flow, opts); + sort(in_flow); } Blueprint::UP @@ -603,15 +603,15 @@ IntermediateBlueprint::optimize(Blueprint* &self, OptimizePass pass) } void -IntermediateBlueprint::sort(InFlow in_flow, const Options &opts) +IntermediateBlueprint::sort(InFlow in_flow) { strict(in_flow.strict()); // authorative strict tag (->fetchPostings,->createSearch,->createFilterSearch) - if (!opts.keep_order()) [[likely]] { - sort(_children, in_flow.strict(), opts.sort_by_cost()); + if (!opt_keep_order()) [[likely]] { + sort(_children, in_flow.strict(), opt_sort_by_cost()); } auto flow = my_flow(in_flow); for (size_t i = 0; i < _children.size(); ++i) { - _children[i]->sort(InFlow(flow.strict(), flow.flow()), opts); + _children[i]->sort(InFlow(flow.strict(), flow.flow())); flow.add(_children[i]->estimate()); } } @@ -824,7 +824,7 @@ LeafBlueprint::set_tree_size(uint32_t value) //----------------------------------------------------------------------------- void -SimpleLeafBlueprint::sort(InFlow in_flow, const Options &) +SimpleLeafBlueprint::sort(InFlow in_flow) { strict(in_flow.strict()); // authorative strict tag (->fetchPostings,->createSearch,->createFilterSearch) } diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.h b/searchlib/src/vespa/searchlib/queryeval/blueprint.h index e403d7bf456..d57fbeae3b1 100644 --- a/searchlib/src/vespa/searchlib/queryeval/blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.h @@ -61,7 +61,7 @@ public: bool _allow_force_strict; bool _keep_order; public: - constexpr Options() noexcept + constexpr Options() noexcept : _sort_by_cost(false), _allow_force_strict(false), _keep_order(false) {} @@ -80,11 +80,39 @@ public: _keep_order = value; return *this; } - static Options default_options() noexcept { - return Options().sort_by_cost(true); + }; + +private: + static Options &thread_opts() noexcept { + thread_local Options opts; + return opts; + } + struct BindOpts { + Options prev; + BindOpts(Options opts) noexcept : prev(thread_opts()) { + thread_opts() = opts; } + ~BindOpts() noexcept { + thread_opts() = prev; + } + BindOpts(BindOpts &&) = delete; + BindOpts(const BindOpts &) = delete; + BindOpts &operator=(BindOpts &&) = delete; + BindOpts &operator=(const BindOpts &) = delete; }; +public: + // thread local Options are used during query planning (calculate_flow_stats/sort) + // + // The optimize_and_sort function will handle this for you by + // binding the given options to the current thread before calling + // optimize and sort. If you do low-level stuff directly, make + // sure to keep the relevant options bound while doing so. + static BindOpts bind_opts(Options opts) noexcept { return BindOpts(opts); } + static bool opt_sort_by_cost() noexcept { return thread_opts().sort_by_cost(); } + static bool opt_allow_force_strict() noexcept { return thread_opts().allow_force_strict(); } + static bool opt_keep_order() noexcept { return thread_opts().keep_order(); } + struct HitEstimate { uint32_t estHits; bool empty; @@ -286,17 +314,18 @@ public: void null_plan(InFlow in_flow, uint32_t docid_limit); static Blueprint::UP optimize(Blueprint::UP bp); - virtual void sort(InFlow in_flow, const Options &opts) = 0; + virtual void sort(InFlow in_flow) = 0; static Blueprint::UP optimize_and_sort(Blueprint::UP bp, InFlow in_flow, const Options &opts) { + auto opts_guard = bind_opts(opts); auto result = optimize(std::move(bp)); - result->sort(in_flow, opts); + result->sort(in_flow); return result; } static Blueprint::UP optimize_and_sort(Blueprint::UP bp, InFlow in_flow) { - return optimize_and_sort(std::move(bp), in_flow, Options::default_options()); + return optimize_and_sort(std::move(bp), in_flow, Options().sort_by_cost(true)); } static Blueprint::UP optimize_and_sort(Blueprint::UP bp) { - return optimize_and_sort(std::move(bp), true, Options::default_options()); + return optimize_and_sort(std::move(bp), true); } virtual void optimize(Blueprint* &self, OptimizePass pass) = 0; virtual void optimize_self(OptimizePass pass); @@ -454,7 +483,7 @@ public: void each_node_post_order(const std::function &f) override; void optimize(Blueprint* &self, OptimizePass pass) final; - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; void set_global_filter(const GlobalFilter &global_filter, double estimated_hit_ratio) override; IndexList find(const IPredicate & check) const; @@ -535,7 +564,7 @@ struct SimpleLeafBlueprint : LeafBlueprint { explicit SimpleLeafBlueprint() noexcept : LeafBlueprint(true) {} explicit SimpleLeafBlueprint(FieldSpecBase field) noexcept : LeafBlueprint(field, true) {} explicit SimpleLeafBlueprint(FieldSpecBaseList fields) noexcept: LeafBlueprint(std::move(fields), true) {} - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; }; // for leaf nodes representing more complex structures like wand/phrase diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp index 020452265ce..3be1009279b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp @@ -40,11 +40,11 @@ DotProductBlueprint::addTerm(Blueprint::UP term, int32_t weight, HitEstimate & e } void -DotProductBlueprint::sort(InFlow, const Options &opts) +DotProductBlueprint::sort(InFlow) { strict(true); for (auto &term: _terms) { - term->sort(true, opts); + term->sort(true); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h index 370895dd94f..35bb353161a 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h @@ -33,7 +33,7 @@ public: setEstimate(estimate); } - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; FlowStats calculate_flow_stats(uint32_t docid_limit) const override; SearchIteratorUP createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda) const override; diff --git a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp index c42f05b64c7..61ae7b51de1 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp @@ -54,12 +54,12 @@ EquivBlueprint::EquivBlueprint(FieldSpecBaseList fields, EquivBlueprint::~EquivBlueprint() = default; void -EquivBlueprint::sort(InFlow in_flow, const Options &opts) +EquivBlueprint::sort(InFlow in_flow) { strict(in_flow.strict()); auto flow = OrFlow(in_flow); for (auto &term: _terms) { - term->sort(InFlow(flow.strict(), flow.flow()), opts); + term->sort(InFlow(flow.strict(), flow.flow())); flow.add(term->estimate()); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h index 147f8269ecd..21e24ff61e7 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h @@ -22,7 +22,7 @@ public: // used by create visitor EquivBlueprint& addTerm(Blueprint::UP term, double exactness); - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; FlowStats calculate_flow_stats(uint32_t docid_limit) const override; SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda) const override; diff --git a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp index faa4b65e3b0..63697a3405a 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp @@ -126,7 +126,7 @@ NearestNeighborBlueprint::perform_top_k(const search::tensor::NearestNeighborInd } void -NearestNeighborBlueprint::sort(InFlow in_flow, const Options &) +NearestNeighborBlueprint::sort(InFlow in_flow) { strict(in_flow.strict()); } diff --git a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.h index 864ae6c2d47..95a8a6a6afe 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.h @@ -69,7 +69,7 @@ public: Algorithm get_algorithm() const { return _algorithm; } double get_distance_threshold() const { return _distance_threshold; } - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; FlowStats calculate_flow_stats(uint32_t docid_limit) const override { return default_flow_stats(docid_limit, getState().estimate().estHits, 0); } diff --git a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp index 48d2e957252..a3c309d6169 100644 --- a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp @@ -280,7 +280,7 @@ PredicateBlueprint::fetchPostings(const ExecuteInfo &) { } void -PredicateBlueprint::sort(InFlow in_flow, const Options &) +PredicateBlueprint::sort(InFlow in_flow) { strict(in_flow.strict()); } diff --git a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.h index 5cba0f1b949..977dd4ddb4f 100644 --- a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.h @@ -49,7 +49,7 @@ public: ~PredicateBlueprint(); void fetchPostings(const ExecuteInfo &execInfo) override; - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; FlowStats calculate_flow_stats(uint32_t) const override { return default_flow_stats(_interval_btree_iterators.size() + _interval_vector_iterators.size() + _bounds_btree_iterators.size() + _bounds_vector_iterators.size() + 2); diff --git a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp index 7ba4bfc5711..a531df52d15 100644 --- a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp @@ -45,12 +45,12 @@ SameElementBlueprint::addTerm(Blueprint::UP term) } void -SameElementBlueprint::sort(InFlow in_flow, const Options &opts) +SameElementBlueprint::sort(InFlow in_flow) { strict(in_flow.strict()); auto flow = AndFlow(in_flow); for (auto &term: _terms) { - term->sort(InFlow(flow.strict(), flow.flow()), opts); + term->sort(InFlow(flow.strict(), flow.flow())); flow.add(term->estimate()); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.h index 61e2a85d5e2..1d7fc017f69 100644 --- a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.h @@ -34,7 +34,7 @@ public: // used by create visitor void addTerm(Blueprint::UP term); - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; FlowStats calculate_flow_stats(uint32_t docid_limit) const override; void optimize_self(OptimizePass pass) override; diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp index 0867a072c3b..621fb101d5d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp @@ -46,11 +46,11 @@ SimplePhraseBlueprint::addTerm(Blueprint::UP term) } void -SimplePhraseBlueprint::sort(InFlow in_flow, const Options &opts) +SimplePhraseBlueprint::sort(InFlow in_flow) { strict(in_flow.strict()); for (auto &term: _terms) { - term->sort(in_flow, opts); + term->sort(in_flow); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h index 14717742c30..1b9c402bfde 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h @@ -30,7 +30,7 @@ public: // used by create visitor void addTerm(Blueprint::UP term); - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; FlowStats calculate_flow_stats(uint32_t docid_limit) const override; SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda) const override; diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp index e90cce219d7..c0beaf19d70 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp @@ -67,12 +67,12 @@ ParallelWeakAndBlueprint::addTerm(Blueprint::UP term, int32_t weight, HitEstimat } void -ParallelWeakAndBlueprint::sort(InFlow in_flow, const Options &opts) +ParallelWeakAndBlueprint::sort(InFlow in_flow) { strict(in_flow.strict()); auto flow = OrFlow(in_flow); for (auto &term: _terms) { - term->sort(InFlow(flow.strict(), flow.flow()), opts); + term->sort(InFlow(flow.strict(), flow.flow())); flow.add(term->estimate()); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h index 22f8ee1bf6f..4a55bf14095 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h @@ -62,7 +62,7 @@ public: set_tree_size(_terms.size() + 1); } - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; FlowStats calculate_flow_stats(uint32_t docid_limit) const override; SearchIterator::UP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda) const override; diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp index f1a8a72f2f8..49c48718420 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp @@ -94,11 +94,11 @@ WeightedSetTermBlueprint::addTerm(Blueprint::UP term, int32_t weight, HitEstimat } void -WeightedSetTermBlueprint::sort(InFlow, const Options &opts) +WeightedSetTermBlueprint::sort(InFlow) { strict(true); for (auto &term: _terms) { - term->sort(true, opts); + term->sort(true); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h index 47deff058a0..250d7aeff62 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h @@ -35,7 +35,7 @@ public: setEstimate(estimate); } - void sort(InFlow in_flow, const Options &opts) override; + void sort(InFlow in_flow) override; FlowStats calculate_flow_stats(uint32_t docid_limit) const override; SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda) const override; -- cgit v1.2.3