diff --git a/core/search/all_docs_provider.cpp b/core/search/all_docs_provider.cpp index 3520e71e5..542fa95ea 100644 --- a/core/search/all_docs_provider.cpp +++ b/core/search/all_docs_provider.cpp @@ -26,7 +26,7 @@ namespace irs { -FilterWithBoost::Ptr AllDocsProvider::Default(score_t boost) { +AllDocsProvider::Ptr AllDocsProvider::Default(score_t boost) { auto filter = std::make_unique(); filter->boost(boost); return filter; diff --git a/core/search/all_docs_provider.hpp b/core/search/all_docs_provider.hpp index a066b839e..82700fe6a 100644 --- a/core/search/all_docs_provider.hpp +++ b/core/search/all_docs_provider.hpp @@ -28,13 +28,12 @@ namespace irs { class AllDocsProvider { public: - using ProviderFunc = std::function; + using Ptr = std::unique_ptr; + using ProviderFunc = std::function; - static FilterWithBoost::Ptr Default(score_t boost); + static Ptr Default(score_t boost); - FilterWithBoost::Ptr MakeAllDocsFilter(score_t boost) const { - return all_docs_(boost); - } + Ptr MakeAllDocsFilter(score_t boost) const { return all_docs_(boost); } void SetProvider(ProviderFunc&& provider) { all_docs_ = provider ? std::move(provider) : ProviderFunc{&Default}; diff --git a/core/search/all_filter.hpp b/core/search/all_filter.hpp index f5d8bc052..273d0d287 100644 --- a/core/search/all_filter.hpp +++ b/core/search/all_filter.hpp @@ -29,7 +29,7 @@ namespace irs { // Filter returning all documents class all : public FilterWithBoost { public: - filter::prepared::ptr prepare(const PrepareContext& ctx) const final; + prepared::ptr prepare(const PrepareContext& ctx) const final; irs::type_info::type_id type() const noexcept final { return irs::type::id(); diff --git a/core/search/boolean_filter.cpp b/core/search/boolean_filter.cpp index fca1bde98..bbc85ae98 100644 --- a/core/search/boolean_filter.cpp +++ b/core/search/boolean_filter.cpp @@ -75,8 +75,8 @@ filter::prepared::ptr boolean_filter::prepare(const PrepareContext& ctx) const { std::vector incl; std::vector excl; - FilterWithBoost::Ptr all_docs_zero_boost; - FilterWithBoost::Ptr all_docs_no_boost; + AllDocsProvider::Ptr all_docs_zero_boost; + AllDocsProvider::Ptr all_docs_no_boost; group_filters(all_docs_zero_boost, incl, excl); @@ -89,7 +89,7 @@ filter::prepared::ptr boolean_filter::prepare(const PrepareContext& ctx) const { return PrepareBoolean(incl, excl, ctx); } -void boolean_filter::group_filters(FilterWithBoost::Ptr& all_docs_zero_boost, +void boolean_filter::group_filters(AllDocsProvider::Ptr& all_docs_zero_boost, std::vector& incl, std::vector& excl) const { incl.reserve(size() / 2); @@ -98,7 +98,7 @@ void boolean_filter::group_filters(FilterWithBoost::Ptr& all_docs_zero_boost, const filter* empty_filter = nullptr; const auto is_or = type() == irs::type::id(); for (const auto& filter : *this) { - if (irs::type::id() == filter->type()) { + if (irs::type::id() == filter->type()) { empty_filter = filter.get(); continue; } @@ -143,7 +143,7 @@ filter::prepared::ptr And::PrepareBoolean(std::vector& incl, // optimization step // if include group empty itself or has 'empty' -> this whole conjunction is // empty - if (incl.empty() || incl.back()->type() == irs::type::id()) { + if (incl.empty() || incl.back()->type() == irs::type::id()) { return prepared::empty(); } @@ -228,7 +228,7 @@ filter::prepared::ptr Or::PrepareBoolean(std::vector& incl, return MakeAllDocsFilter(kNoBoost)->prepare(sub_ctx); } - if (!incl.empty() && incl.back()->type() == irs::type::id()) { + if (!incl.empty() && incl.back()->type() == irs::type::id()) { incl.pop_back(); } diff --git a/core/search/boolean_filter.hpp b/core/search/boolean_filter.hpp index 4fbabea0c..71dc62845 100644 --- a/core/search/boolean_filter.hpp +++ b/core/search/boolean_filter.hpp @@ -67,7 +67,7 @@ class boolean_filter : public FilterWithBoost, public AllDocsProvider { const PrepareContext& ctx) const = 0; private: - void group_filters(FilterWithBoost::Ptr& all_docs_zero_boost, + void group_filters(AllDocsProvider::Ptr& all_docs_zero_boost, std::vector& incl, std::vector& excl) const; @@ -114,7 +114,7 @@ class Or final : public boolean_filter { }; // Represents negation -class Not : public FilterWithBoost, public AllDocsProvider { +class Not : public FilterWithType, public AllDocsProvider { public: const filter* filter() const { return filter_.get(); } @@ -135,10 +135,6 @@ class Not : public FilterWithBoost, public AllDocsProvider { prepared::ptr prepare(const PrepareContext& ctx) const final; - type_info::type_id type() const noexcept final { - return irs::type::id(); - } - protected: bool equals(const irs::filter& rhs) const noexcept final; diff --git a/core/search/column_existence_filter.hpp b/core/search/column_existence_filter.hpp index 84c0762fc..c492ad79f 100644 --- a/core/search/column_existence_filter.hpp +++ b/core/search/column_existence_filter.hpp @@ -45,9 +45,9 @@ struct by_column_existence_options { // User-side column existence filter class by_column_existence final - : public filter_base { + : public FilterWithField { public: - filter::prepared::ptr prepare(const PrepareContext& ctx) const final; + prepared::ptr prepare(const PrepareContext& ctx) const final; }; } // namespace irs diff --git a/core/search/filter.cpp b/core/search/filter.cpp index a0eb7fe78..4d567ebe8 100644 --- a/core/search/filter.cpp +++ b/core/search/filter.cpp @@ -46,11 +46,11 @@ EmptyQuery kEmptyQuery; } // namespace filter::prepared::ptr filter::prepared::empty() { - return memory::to_managed(kEmptyQuery); + return memory::to_managed(kEmptyQuery); } -filter::prepared::ptr empty::prepare(const PrepareContext& /*ctx*/) const { - return memory::to_managed(kEmptyQuery); +filter::prepared::ptr Empty::prepare(const PrepareContext& /*ctx*/) const { + return memory::to_managed(kEmptyQuery); } } // namespace irs diff --git a/core/search/filter.hpp b/core/search/filter.hpp index e1232bf57..a8f6bf68a 100644 --- a/core/search/filter.hpp +++ b/core/search/filter.hpp @@ -73,6 +73,7 @@ class filter { virtual void visit(const SubReader& segment, PreparedStateVisitor& visitor, score_t boost) const = 0; + // test only member virtual score_t boost() const noexcept = 0; }; @@ -80,7 +81,9 @@ class filter { virtual ~filter() = default; - bool operator==(const filter& rhs) const noexcept { return equals(rhs); } + IRS_FORCE_INLINE bool operator==(const filter& rhs) const noexcept { + return equals(rhs); + } virtual prepared::ptr prepare(const PrepareContext& ctx) const = 0; @@ -97,8 +100,6 @@ class filter { class FilterWithBoost : public filter { public: - using Ptr = std::unique_ptr; - score_t boost() const noexcept { return boost_; } void boost(score_t boost) noexcept { boost_ = boost; } @@ -109,9 +110,19 @@ class FilterWithBoost : public filter { score_t boost_ = kNoBoost; }; +template +class FilterWithType : public FilterWithBoost { + public: + using filter_type = Type; + + type_info::type_id type() const noexcept final { + return irs::type::id(); + } +}; + // Convenient base class filters with options template -class filter_with_options : public FilterWithBoost { +class FilterWithOptions : public FilterWithType { public: using options_type = Options; using filter_type = typename options_type::filter_type; @@ -119,10 +130,6 @@ class filter_with_options : public FilterWithBoost { const options_type& options() const noexcept { return options_; } options_type* mutable_options() noexcept { return &options_; } - type_info::type_id type() const noexcept final { - return irs::type::id(); - } - protected: bool equals(const filter& rhs) const noexcept override { return filter::equals(rhs) && @@ -130,14 +137,14 @@ class filter_with_options : public FilterWithBoost { } private: - options_type options_; + IRS_NO_UNIQUE_ADDRESS options_type options_; }; // Convenient base class for single field filters template -class filter_base : public filter_with_options { +class FilterWithField : public FilterWithOptions { public: - using options_type = typename filter_with_options::options_type; + using options_type = typename FilterWithOptions::options_type; using filter_type = typename options_type::filter_type; std::string_view field() const noexcept { return field_; } @@ -145,7 +152,7 @@ class filter_base : public filter_with_options { protected: bool equals(const filter& rhs) const noexcept final { - return filter_with_options::equals(rhs) && + return FilterWithOptions::equals(rhs) && field_ == DownCast(rhs).field_; } @@ -154,13 +161,9 @@ class filter_base : public filter_with_options { }; // Filter which returns no documents -class empty final : public FilterWithBoost { +class Empty final : public FilterWithType { public: - filter::prepared::ptr prepare(const PrepareContext& ctx) const final; - - type_info::type_id type() const noexcept final { - return irs::type::id(); - } + prepared::ptr prepare(const PrepareContext& ctx) const final; }; struct filter_visitor; diff --git a/core/search/granular_range_filter.hpp b/core/search/granular_range_filter.hpp index 73fdc38f8..280fbc298 100644 --- a/core/search/granular_range_filter.hpp +++ b/core/search/granular_range_filter.hpp @@ -91,18 +91,18 @@ void set_granular_term(by_granular_range_options::terms& boundary, /// termA@0 + termA@2 + termA@5 + termA@10 /// termB@0 + termB@2 + termB@6 + termB@10 ////////////////////////////////////////////////////////////////////////////// -class by_granular_range : public filter_base { +class by_granular_range : public FilterWithField { public: - static filter::prepared::ptr prepare(const PrepareContext& ctx, - std::string_view field, - const options_type::range_type& rng, - size_t scored_terms_limit); + static prepared::ptr prepare(const PrepareContext& ctx, + std::string_view field, + const options_type::range_type& rng, + size_t scored_terms_limit); static void visit(const SubReader& segment, const term_reader& reader, const options_type::range_type& rng, filter_visitor& visitor); - filter::prepared::ptr prepare(const PrepareContext& ctx) const final { + prepared::ptr prepare(const PrepareContext& ctx) const final { return prepare(ctx.Boost(boost()), field(), options().range, options().scored_terms_limit); } diff --git a/core/search/levenshtein_filter.cpp b/core/search/levenshtein_filter.cpp index e625dfa32..2f59bd18b 100644 --- a/core/search/levenshtein_filter.cpp +++ b/core/search/levenshtein_filter.cpp @@ -286,8 +286,8 @@ filter::prepared::ptr by_edit_distance::prepare( bool with_transpositions, bytes_view prefix) { return executeLevenshtein( max_distance, provider, with_transpositions, prefix, term, - []() -> filter::prepared::ptr { return prepared::empty(); }, - [&]() -> filter::prepared::ptr { + []() -> prepared::ptr { return prepared::empty(); }, + [&]() -> prepared::ptr { if (!prefix.empty() && !term.empty()) { bstring target; target.reserve(prefix.size() + term.size()); @@ -300,7 +300,7 @@ filter::prepared::ptr by_edit_distance::prepare( }, [&, scored_terms_limit](const parametric_description& d, const bytes_view prefix, - const bytes_view term) -> filter::prepared::ptr { + const bytes_view term) -> prepared::ptr { return prepare_levenshtein_filter(ctx, field, prefix, term, scored_terms_limit, d); }); diff --git a/core/search/levenshtein_filter.hpp b/core/search/levenshtein_filter.hpp index 5eba5ee84..ee4ebdd14 100644 --- a/core/search/levenshtein_filter.hpp +++ b/core/search/levenshtein_filter.hpp @@ -90,7 +90,8 @@ struct by_edit_distance_options : by_edit_distance_all_options { /// @class by_edit_distance /// @brief user-side levenstein filter //////////////////////////////////////////////////////////////////////////////// -class by_edit_distance final : public filter_base { +class by_edit_distance final + : public FilterWithField { public: static prepared::ptr prepare(const PrepareContext& ctx, std::string_view field, bytes_view term, @@ -100,7 +101,7 @@ class by_edit_distance final : public filter_base { static field_visitor visitor(const by_edit_distance_all_options& options); - filter::prepared::ptr prepare(const PrepareContext& ctx) const final { + prepared::ptr prepare(const PrepareContext& ctx) const final { auto sub_ctx = ctx; sub_ctx.boost *= boost(); return prepare(sub_ctx, field(), options().term, options().max_terms, diff --git a/core/search/nested_filter.hpp b/core/search/nested_filter.hpp index 45416e5d2..7ec65bde3 100644 --- a/core/search/nested_filter.hpp +++ b/core/search/nested_filter.hpp @@ -91,7 +91,7 @@ struct ByNestedOptions { }; // Filter is capable of finding parents by the corresponding child filter. -class ByNestedFilter final : public filter_with_options { +class ByNestedFilter final : public FilterWithOptions { public: prepared::ptr prepare(const PrepareContext& ctx) const final; }; diff --git a/core/search/ngram_similarity_filter.hpp b/core/search/ngram_similarity_filter.hpp index 7bffdde9a..bc6426bcb 100644 --- a/core/search/ngram_similarity_filter.hpp +++ b/core/search/ngram_similarity_filter.hpp @@ -46,7 +46,8 @@ struct by_ngram_similarity_options { } }; -class by_ngram_similarity : public filter_base { +class by_ngram_similarity + : public FilterWithField { public: static prepared::ptr Prepare(const PrepareContext& ctx, std::string_view field_name, diff --git a/core/search/phrase_filter.cpp b/core/search/phrase_filter.cpp index bf1865a57..96d1ec8ba 100644 --- a/core/search/phrase_filter.cpp +++ b/core/search/phrase_filter.cpp @@ -444,9 +444,8 @@ filter::prepared::ptr by_phrase::Prepare(const PrepareContext& ctx, if (1 == options.size()) { auto query = std::visit(PrepareVisitor{ctx, field}, options.begin()->second); - if (query) { - return query; - } + IRS_ASSERT(query); + return query; } // prepare phrase stats (collector for each term) diff --git a/core/search/phrase_filter.hpp b/core/search/phrase_filter.hpp index a735cf694..3d0948465 100644 --- a/core/search/phrase_filter.hpp +++ b/core/search/phrase_filter.hpp @@ -132,7 +132,7 @@ class by_phrase_options { bool is_simple_term_only_{true}; }; -class by_phrase : public filter_base { +class by_phrase : public FilterWithField { public: static prepared::ptr Prepare(const PrepareContext& ctx, std::string_view field, diff --git a/core/search/prefix_filter.hpp b/core/search/prefix_filter.hpp index fb495d258..fdab67060 100644 --- a/core/search/prefix_filter.hpp +++ b/core/search/prefix_filter.hpp @@ -64,7 +64,7 @@ struct by_prefix_options : by_prefix_filter_options { /// @class by_prefix /// @brief user-side prefix filter //////////////////////////////////////////////////////////////////////////////// -class by_prefix : public filter_base { +class by_prefix : public FilterWithField { public: static prepared::ptr prepare(const PrepareContext& ctx, std::string_view field, bytes_view prefix, @@ -73,7 +73,7 @@ class by_prefix : public filter_base { static void visit(const SubReader& segment, const term_reader& reader, bytes_view prefix, filter_visitor& visitor); - filter::prepared::ptr prepare(const PrepareContext& ctx) const final { + prepared::ptr prepare(const PrepareContext& ctx) const final { auto sub_ctx = ctx; sub_ctx.boost *= boost(); return prepare(sub_ctx, field(), options().term, diff --git a/core/search/proxy_filter.hpp b/core/search/proxy_filter.hpp index 850761adb..d65e370ac 100644 --- a/core/search/proxy_filter.hpp +++ b/core/search/proxy_filter.hpp @@ -42,7 +42,7 @@ class proxy_filter final : public filter { public: using cache_ptr = std::shared_ptr; - filter::prepared::ptr prepare(const PrepareContext& ctx) const final; + prepared::ptr prepare(const PrepareContext& ctx) const final; template std::pair set_filter(IResourceManager& memory, diff --git a/core/search/range_filter.hpp b/core/search/range_filter.hpp index f17ab7d7f..50698a97f 100644 --- a/core/search/range_filter.hpp +++ b/core/search/range_filter.hpp @@ -67,7 +67,7 @@ struct by_range_options : by_range_filter_options { /// @class by_range /// @brief user-side term range filter ////////////////////////////////////////////////////////////////////////////// -class by_range : public filter_base { +class by_range : public FilterWithField { public: static prepared::ptr prepare(const PrepareContext& ctx, std::string_view field, @@ -78,7 +78,7 @@ class by_range : public filter_base { const options_type::range_type& rng, filter_visitor& visitor); - filter::prepared::ptr prepare(const PrepareContext& ctx) const final { + prepared::ptr prepare(const PrepareContext& ctx) const final { return prepare(ctx.Boost(boost()), field(), options().range, options().scored_terms_limit); } diff --git a/core/search/same_position_filter.hpp b/core/search/same_position_filter.hpp index 7ca192669..10d14b8c6 100644 --- a/core/search/same_position_filter.hpp +++ b/core/search/same_position_filter.hpp @@ -43,13 +43,13 @@ struct by_same_position_options { } }; -class by_same_position : public filter_with_options { +class by_same_position : public FilterWithOptions { public: // Returns features required for the filter static constexpr IndexFeatures kRequiredFeatures = IndexFeatures::FREQ | IndexFeatures::POS; - filter::prepared::ptr prepare(const PrepareContext& ctx) const final; + prepared::ptr prepare(const PrepareContext& ctx) const final; }; } // namespace irs diff --git a/core/search/term_filter.hpp b/core/search/term_filter.hpp index 3cd2d31a6..5ede708b7 100644 --- a/core/search/term_filter.hpp +++ b/core/search/term_filter.hpp @@ -42,7 +42,7 @@ struct by_term_options { }; // User-side term filter -class by_term : public filter_base { +class by_term : public FilterWithField { public: static prepared::ptr prepare(const PrepareContext& ctx, std::string_view field, bytes_view term); diff --git a/core/search/terms_filter.cpp b/core/search/terms_filter.cpp index 82cbdd364..114806cd0 100644 --- a/core/search/terms_filter.cpp +++ b/core/search/terms_filter.cpp @@ -106,8 +106,7 @@ void by_terms::visit(const SubReader& segment, const term_reader& field, filter::prepared::ptr by_terms::Prepare(const PrepareContext& ctx, std::string_view field, - const by_terms_options& options, - const AllDocsProvider& provider) { + const by_terms_options& options) { const auto& [terms, min_match, merge_type] = options; const size_t size = terms.size(); @@ -115,29 +114,7 @@ filter::prepared::ptr by_terms::Prepare(const PrepareContext& ctx, // Empty or unreachable search criteria return prepared::empty(); } - - if (0 == min_match) { - if (ctx.scorers.empty()) { - return provider.MakeAllDocsFilter(kNoBoost)->prepare({ - .index = ctx.index, - .memory = ctx.memory, - }); - } - Or disj; - // Don't contribute to the score - disj.add(provider.MakeAllDocsFilter(0.)); - // Reset min_match to 1 - auto& terms = disj.add(); - *terms.mutable_field() = field; - *terms.mutable_options() = options; - terms.mutable_options()->min_match = 1; - return disj.prepare({ - .index = ctx.index, - .memory = ctx.memory, - .scorers = ctx.scorers, - .ctx = ctx.ctx, - }); - } + IRS_ASSERT(min_match != 0); if (1 == size) { const auto term = std::begin(terms); @@ -176,4 +153,30 @@ filter::prepared::ptr by_terms::Prepare(const PrepareContext& ctx, merge_type, min_match); } +filter::prepared::ptr by_terms::prepare(const PrepareContext& ctx) const { + if (options().terms.empty() || options().min_match != 0) { + return Prepare(ctx, field(), options()); + } + if (ctx.scorers.empty()) { + return MakeAllDocsFilter(kNoBoost)->prepare({ + .index = ctx.index, + .memory = ctx.memory, + }); + } + Or disj; + // Don't contribute to the score + disj.add(MakeAllDocsFilter(0.F)); + // Reset min_match to 1 + auto& terms = disj.add(); + *terms.mutable_field() = field(); + *terms.mutable_options() = options(); + terms.mutable_options()->min_match = 1; + return disj.prepare({ + .index = ctx.index, + .memory = ctx.memory, + .scorers = ctx.scorers, + .ctx = ctx.ctx, + }); +} + } // namespace irs diff --git a/core/search/terms_filter.hpp b/core/search/terms_filter.hpp index aff0c3f65..636ab4bf4 100644 --- a/core/search/terms_filter.hpp +++ b/core/search/terms_filter.hpp @@ -70,7 +70,7 @@ struct by_terms_options { }; // Filter by a set of terms -class by_terms final : public filter_base, +class by_terms final : public FilterWithField, public AllDocsProvider { public: static void visit(const SubReader& segment, const term_reader& field, @@ -79,12 +79,9 @@ class by_terms final : public filter_base, static prepared::ptr Prepare(const PrepareContext& ctx, std::string_view field, - const by_terms_options& options, - const AllDocsProvider& provider = {}); + const by_terms_options& options); - prepared::ptr prepare(const PrepareContext& ctx) const final { - return Prepare(ctx.Boost(boost()), field(), options(), *this); - } + prepared::ptr prepare(const PrepareContext& ctx) const final; }; } // namespace irs diff --git a/core/search/wildcard_filter.cpp b/core/search/wildcard_filter.cpp index b08ebd886..94c252702 100644 --- a/core/search/wildcard_filter.cpp +++ b/core/search/wildcard_filter.cpp @@ -129,13 +129,13 @@ filter::prepared::ptr by_wildcard::prepare(const PrepareContext& ctx, bstring buf; return ExecuteWildcard( buf, term, - [&](bytes_view term) -> filter::prepared::ptr { + [&](bytes_view term) -> prepared::ptr { return by_term::prepare(ctx, field, term); }, - [&, scored_terms_limit](bytes_view term) -> filter::prepared::ptr { + [&, scored_terms_limit](bytes_view term) -> prepared::ptr { return by_prefix::prepare(ctx, field, term, scored_terms_limit); }, - [&, scored_terms_limit](bytes_view term) -> filter::prepared::ptr { + [&, scored_terms_limit](bytes_view term) -> prepared::ptr { return PrepareAutomatonFilter(ctx, field, FromWildcard(term), scored_terms_limit); }); diff --git a/core/search/wildcard_filter.hpp b/core/search/wildcard_filter.hpp index bc2abdc2f..441d82e06 100644 --- a/core/search/wildcard_filter.hpp +++ b/core/search/wildcard_filter.hpp @@ -53,7 +53,7 @@ struct by_wildcard_options : by_wildcard_filter_options { }; // User-side wildcard filter -class by_wildcard final : public filter_base { +class by_wildcard final : public FilterWithField { public: static prepared::ptr prepare(const PrepareContext& ctx, std::string_view field, bytes_view term, @@ -61,7 +61,7 @@ class by_wildcard final : public filter_base { static field_visitor visitor(bytes_view term); - filter::prepared::ptr prepare(const PrepareContext& ctx) const final { + prepared::ptr prepare(const PrepareContext& ctx) const final { return prepare(ctx.Boost(boost()), field(), options().term, options().scored_terms_limit); } diff --git a/tests/search/boolean_filter_tests.cpp b/tests/search/boolean_filter_tests.cpp index 3aa89b609..17ade2195 100644 --- a/tests/search/boolean_filter_tests.cpp +++ b/tests/search/boolean_filter_tests.cpp @@ -15625,7 +15625,7 @@ TEST_P(boolean_filter_test_case, or_sequential) { { irs::Or root; append(root, "name", "A"); // 1 - root.add(); + root.add(); CheckQuery(root, Docs{1}, rdr); } @@ -15635,7 +15635,7 @@ TEST_P(boolean_filter_test_case, or_sequential) { irs::Or root; root.add().filter() = make_filter("name", "A"); // 1 - root.add(); + root.add(); CheckQuery( root, Docs{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, @@ -16760,9 +16760,9 @@ TEST(Or_test, optimize_all_unscored) { node.docs = {3}; } root.add(); - root.add(); + root.add(); root.add(); - root.add(); + root.add(); auto prep = root.prepare({.index = irs::SubReader::empty()}); @@ -16787,9 +16787,9 @@ TEST(Or_test, optimize_all_scored) { node.docs = {3}; } root.add(); - root.add(); + root.add(); root.add(); - root.add(); + root.add(); tests::sort::boost sort{}; auto pord = irs::Scorers::Prepare(sort); auto prep = root.prepare({.index = irs::SubReader::empty(), .scorers = pord}); diff --git a/tests/search/empty_filter_tests.cpp b/tests/search/empty_filter_tests.cpp index 2c1d2789d..4d4bdba7d 100644 --- a/tests/search/empty_filter_tests.cpp +++ b/tests/search/empty_filter_tests.cpp @@ -40,7 +40,7 @@ TEST_P(empty_filter_test_case, empty) { std::vector cost{0}; - CheckQuery(irs::empty(), Docs{}, cost, rdr); + CheckQuery(irs::Empty{}, Docs{}, cost, rdr); } static constexpr auto kTestDirs = tests::getDirectories(); diff --git a/tests/search/nested_filter_test.cpp b/tests/search/nested_filter_test.cpp index 07f018cf3..7c97bd9ac 100644 --- a/tests/search/nested_filter_test.cpp +++ b/tests/search/nested_filter_test.cpp @@ -1144,7 +1144,7 @@ TEST_P(NestedFilterTestCase, JoinNone2) { irs::ByNestedFilter filter; auto& opts = *filter.mutable_options(); - opts.child = std::make_unique(); + opts.child = std::make_unique(); opts.parent = MakeParentProvider("customer"); opts.match = irs::kMatchNone; filter.boost(1.f); @@ -1205,7 +1205,7 @@ TEST_P(NestedFilterTestCase, JoinNone3) { irs::ByNestedFilter filter; auto& opts = *filter.mutable_options(); - opts.child = std::make_unique(); + opts.child = std::make_unique(); // Bitset iterator doesn't provide score, check that wrapper works correctly opts.parent = [word = irs::bitset::word_t{}](