diff options
Diffstat (limited to 'searchlib/src/tests/queryeval/blueprint/mysearch.h')
-rw-r--r-- | searchlib/src/tests/queryeval/blueprint/mysearch.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/searchlib/src/tests/queryeval/blueprint/mysearch.h b/searchlib/src/tests/queryeval/blueprint/mysearch.h index db7dd2adae6..6eb27364c2b 100644 --- a/searchlib/src/tests/queryeval/blueprint/mysearch.h +++ b/searchlib/src/tests/queryeval/blueprint/mysearch.h @@ -104,7 +104,8 @@ public: class MyLeaf : public SimpleLeafBlueprint { using TFMDA = search::fef::TermFieldMatchDataArray; - bool _got_global_filter; + bool _got_global_filter = false; + double _cost = 1.0; public: SearchIterator::UP @@ -113,18 +114,15 @@ public: return std::make_unique<MySearch>("leaf", tfmda, strict); } - MyLeaf() - : SimpleLeafBlueprint(), _got_global_filter(false) - {} - MyLeaf(FieldSpecBaseList fields) - : SimpleLeafBlueprint(std::move(fields)), _got_global_filter(false) - {} - + MyLeaf() : SimpleLeafBlueprint() {} + MyLeaf(FieldSpecBaseList fields) : SimpleLeafBlueprint(std::move(fields)) {} + void set_cost(double value) noexcept { _cost = value; } + double calculate_cost() const override { return _cost; } + MyLeaf &estimate(uint32_t hits, bool empty = false) { setEstimate(HitEstimate(hits, empty)); return *this; } - MyLeaf &cost_tier(uint32_t value) { set_cost_tier(value); return *this; @@ -153,7 +151,7 @@ private: public: explicit MyLeafSpec(uint32_t estHits, bool empty = false) - : _fields(), _estimate(estHits, empty), _cost_tier(0), _want_global_filter(false) {} + : _fields(), _estimate(estHits, empty), _cost_tier(0), _want_global_filter(false) {} MyLeafSpec &addField(uint32_t fieldId, uint32_t handle) { _fields.add(FieldSpecBase(fieldId, handle)); |