From 2c92cf12501eecf4c12d67515b93fb095ceda21b Mon Sep 17 00:00:00 2001 From: Geir Storli Date: Thu, 23 Nov 2023 14:39:13 +0000 Subject: Rename IDocumentWeightAttribute to IDocidWithWeightPostingStore. Also introduce a baseline interface IDirectPostingStore. This prepares for the introduction of IDocidPostingStore that will be implemented by single-value attributes with fast-search. --- .../tests/attribute/bitvector/bitvector_test.cpp | 26 +++++----- .../document_weight_iterator_test.cpp | 56 +++++++++++----------- .../document_weight_or_filter_search_test.cpp | 2 +- .../imported_attribute_vector_test.cpp | 4 +- .../searchable/attributeblueprint_test.cpp | 2 +- .../queryeval/dot_product/dot_product_test.cpp | 2 +- .../matching_elements_search_test.cpp | 20 ++++---- .../parallel_weak_and/parallel_weak_and_test.cpp | 43 +++++++++-------- .../weighted_set_term/weighted_set_term_test.cpp | 2 +- 9 files changed, 78 insertions(+), 79 deletions(-) (limited to 'searchlib/src/tests') diff --git a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp index dfea4901180..181c0fdf110 100644 --- a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp +++ b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp @@ -1,23 +1,21 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include - +#include #include #include -#include -#include +#include +#include #include -#include +#include #include -#include -#include #include -#include -#include +#include +#include #include +#include +#include #include - LOG_SETUP("bitvector_test"); using search::AttributeFactory; @@ -431,12 +429,12 @@ BitVectorTest::test(BasicType bt, CollectionType ct, const vespalib::string &pre checkSearch(v, std::move(sc), 2, 1022, 205, !fastSearch && !filter, true); sc = getSearch(tv, filter); checkSearch(v, std::move(sc), 2, 1022, 205, !filter, true); - const search::IDocumentWeightAttribute *dwa = v->asDocumentWeightAttribute(); - if (dwa != nullptr) { - auto lres = dwa->lookup(getSearchStr(), dwa->get_dictionary_snapshot()); + const auto* dww = v->as_docid_with_weight_posting_store(); + if (dww != nullptr) { + auto lres = dww->lookup(getSearchStr(), dww->get_dictionary_snapshot()); using DWSI = search::queryeval::DocumentWeightSearchIterator; TermFieldMatchData md; - auto dwsi = std::make_unique(md, *dwa, lres); + auto dwsi = std::make_unique(md, *dww, lres); if (!filter) { TEST_DO(checkSearch(v, std::move(dwsi), md, 2, 1022, 205, !filter, true)); } else { diff --git a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp index 6b0ddbc6e35..e2864773c96 100644 --- a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp +++ b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp @@ -1,18 +1,18 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include #include +#include #include #include -#include #include -#include +#include #include #include #include #include -#include -#include #include +#include #include LOG_SETUP("document_weight_iterator_test"); @@ -58,9 +58,9 @@ void populate_string(AttributeVector::SP attr_ptr) { struct LongFixture { AttributeVector::SP attr; - const IDocumentWeightAttribute *api; + const IDocidWithWeightPostingStore *api; LongFixture() : attr(make_attribute(BasicType::INT64, CollectionType::WSET, true)), - api(attr->asDocumentWeightAttribute()) + api(attr->as_docid_with_weight_posting_store()) { ASSERT_TRUE(api != nullptr); add_docs(attr); @@ -70,9 +70,9 @@ struct LongFixture { struct StringFixture { AttributeVector::SP attr; - const IDocumentWeightAttribute *api; + const IDocidWithWeightPostingStore *api; StringFixture() : attr(make_attribute(BasicType::STRING, CollectionType::WSET, true)), - api(attr->asDocumentWeightAttribute()) + api(attr->as_docid_with_weight_posting_store()) { ASSERT_TRUE(api != nullptr); add_docs(attr); @@ -81,33 +81,33 @@ struct StringFixture { }; TEST("require that appropriate attributes support the document weight attribute interface") { - EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::WSET, true)->asDocumentWeightAttribute() != nullptr); - EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::WSET, true)->asDocumentWeightAttribute() != nullptr); + EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::WSET, true)->as_docid_with_weight_posting_store() != nullptr); + EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::WSET, true)->as_docid_with_weight_posting_store() != nullptr); } TEST("require that inappropriate attributes do not support the document weight attribute interface") { - EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::SINGLE, false)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::ARRAY, false)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::WSET, false)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::SINGLE, true)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::ARRAY, true)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::SINGLE, false)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::ARRAY, false)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::WSET, false)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::SINGLE, true)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::ARRAY, true)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::INT32, CollectionType::WSET, true)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::DOUBLE, CollectionType::WSET, true)->asDocumentWeightAttribute() == nullptr); -} - -void verify_valid_lookup(IDocumentWeightAttribute::LookupResult result) { + EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::SINGLE, false)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::ARRAY, false)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::WSET, false)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::SINGLE, true)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::ARRAY, true)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::SINGLE, false)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::ARRAY, false)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::WSET, false)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::SINGLE, true)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::ARRAY, true)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::INT32, CollectionType::WSET, true)->as_docid_with_weight_posting_store() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::DOUBLE, CollectionType::WSET, true)->as_docid_with_weight_posting_store() == nullptr); +} + +void verify_valid_lookup(IDirectPostingStore::LookupResult result) { EXPECT_TRUE(result.posting_idx.valid()); EXPECT_EQUAL(3u, result.posting_size); EXPECT_EQUAL(5, result.min_weight); EXPECT_EQUAL(20, result.max_weight); } -void verify_invalid_lookup(IDocumentWeightAttribute::LookupResult result) { +void verify_invalid_lookup(IDirectPostingStore::LookupResult result) { EXPECT_FALSE(result.posting_idx.valid()); EXPECT_EQUAL(0u, result.posting_size); EXPECT_EQUAL(0, result.min_weight); @@ -124,7 +124,7 @@ TEST_F("require string lookup works correctly", StringFixture) { verify_invalid_lookup(f1.api->lookup("bar", f1.api->get_dictionary_snapshot())); } -void verify_posting(const IDocumentWeightAttribute &api, const char *term) { +void verify_posting(const IDocidWithWeightPostingStore &api, const char *term) { auto result = api.lookup(term, api.get_dictionary_snapshot()); ASSERT_TRUE(result.posting_idx.valid()); std::vector itr_store; @@ -195,7 +195,7 @@ public: ~Verifier(); SearchIterator::UP create(bool strict) const override { (void) strict; - const IDocumentWeightAttribute *api(_attr->asDocumentWeightAttribute()); + const auto* api = _attr->as_docid_with_weight_posting_store(); ASSERT_TRUE(api != nullptr); auto dict_entry = api->lookup("123", api->get_dictionary_snapshot()); ASSERT_TRUE(dict_entry.posting_idx.valid()); diff --git a/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp b/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp index 804e2fdfbd9..ae4812b5437 100644 --- a/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp +++ b/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp @@ -1,7 +1,7 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include -#include +#include #include #include #include diff --git a/searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp b/searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp index eafbbfff103..53fe3c4046a 100644 --- a/searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp +++ b/searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp @@ -140,8 +140,8 @@ TEST_F("getFixedWidth() is inherited from target attribute vector", Fixture) { f.get_imported_attr()->getFixedWidth()); } -TEST_F("asDocumentWeightAttribute() returns nullptr", Fixture) { - EXPECT_TRUE(f.get_imported_attr()->asDocumentWeightAttribute() == nullptr); +TEST_F("as_docid_with_weight_posting_store() returns nullptr", Fixture) { + EXPECT_TRUE(f.get_imported_attr()->as_docid_with_weight_posting_store() == nullptr); } TEST_F("asTensorAttribute() returns nullptr", Fixture) { diff --git a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp index e618b091a7e..39869340cea 100644 --- a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp @@ -315,7 +315,7 @@ public: return result; } void expect_document_weight_attribute() { - EXPECT_TRUE(attr->asDocumentWeightAttribute() != nullptr); + EXPECT_TRUE(attr->as_docid_with_weight_posting_store() != nullptr); } void expect_filter_search(const SimpleResult& upper_and_lower, const Node& term) { expect_filter_search(upper_and_lower, upper_and_lower, term); diff --git a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp index 1538a9ce0df..ed74ae101f3 100644 --- a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp +++ b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp @@ -274,7 +274,7 @@ private: } }; -class WeightIteratorChildrenVerifier : public search::test::DwaIteratorChildrenVerifier { +class WeightIteratorChildrenVerifier : public search::test::DwwIteratorChildrenVerifier { private: SearchIterator::UP create(std::vector && children) const override { diff --git a/searchlib/src/tests/queryeval/matching_elements_search/matching_elements_search_test.cpp b/searchlib/src/tests/queryeval/matching_elements_search/matching_elements_search_test.cpp index b1ff582f3ff..03d7201e103 100644 --- a/searchlib/src/tests/queryeval/matching_elements_search/matching_elements_search_test.cpp +++ b/searchlib/src/tests/queryeval/matching_elements_search/matching_elements_search_test.cpp @@ -1,26 +1,26 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include +#include #include #include -#include +#include #include -#include +#include #include #include -#include #include -using search::attribute::BasicType; -using search::attribute::CollectionType; -using search::attribute::Config; -using search::queryeval::MatchingElementsSearch; using search::AttributeFactory; using search::AttributeVector; -using search::IDocumentWeightAttribute; +using search::IDirectPostingStore; using search::IntegerAttribute; using search::MatchingElements; using search::StringAttribute; +using search::attribute::BasicType; +using search::attribute::CollectionType; +using search::attribute::Config; +using search::queryeval::MatchingElementsSearch; std::shared_ptr make_attribute(BasicType type) { Config cfg(type, CollectionType::WSET); @@ -36,8 +36,8 @@ std::shared_ptr make_attribute(BasicType type) { std::unique_ptr make_search(AttributeVector &attr, const std::vector &terms) { - using LookupResult = IDocumentWeightAttribute::LookupResult; - auto dwa = attr.asDocumentWeightAttribute(); + using LookupResult = IDirectPostingStore::LookupResult; + auto dwa = attr.as_docid_with_weight_posting_store(); assert(dwa != nullptr); auto snapshot = dwa->get_dictionary_snapshot(); std::vector dict_entries; diff --git a/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp b/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp index 6d7d8b42dbb..58f22f19da1 100644 --- a/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp +++ b/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp @@ -1,17 +1,17 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include #include -#include +#include #include -#include -#include +#include #include #include #include #include -#include +#include +#include #include -#include +#include +#include using namespace search::query; using namespace search::queryeval; @@ -21,12 +21,13 @@ using feature_t = search::feature_t; using score_t = wand::score_t; using MatchParams = ParallelWeakAndSearch::MatchParams; using RankParams = ParallelWeakAndSearch::RankParams; -using search::test::DocumentWeightAttributeHelper; -using search::IDocumentWeightAttribute; -using search::fef::TermFieldMatchData; +using search::IDirectPostingStore; +using search::IDocidWithWeightPostingStore; using search::fef::MatchData; using search::fef::MatchDataLayout; using search::fef::TermFieldHandle; +using search::fef::TermFieldMatchData; +using search::test::DocumentWeightAttributeHelper; struct Scores : public std::vector @@ -635,15 +636,15 @@ struct DummyHeap : public WeakAndHeap { void adjust(score_t *, score_t *) override {} }; -SearchIterator::UP create_wand(bool use_dwa, +SearchIterator::UP create_wand(bool use_dww, TermFieldMatchData &tfmd, const MatchParams &matchParams, const std::vector &weights, - const std::vector &dict_entries, - const IDocumentWeightAttribute &attr, + const std::vector &dict_entries, + const IDocidWithWeightPostingStore &attr, bool strict) { - if (use_dwa) { + if (use_dww) { return ParallelWeakAndSearch::create(tfmd, matchParams, weights, dict_entries, attr, strict); } // use search iterators as children @@ -665,25 +666,25 @@ SearchIterator::UP create_wand(bool use_dwa, return SearchIterator::UP(ParallelWeakAndSearch::create(terms, matchParams, RankParams(tfmd, std::move(childrenMatchData)), strict)); } -class Verifier : public search::test::DwaIteratorChildrenVerifier { +class Verifier : public search::test::DwwIteratorChildrenVerifier { public: - Verifier(bool use_dwa) : _use_dwa(use_dwa) { } + Verifier(bool use_dww) : _use_dww(use_dww) { } private: SearchIterator::UP create(bool strict) const override { MatchParams match_params(_dummy_heap, _dummy_heap.getMinScore(), 1.0, 1); - std::vector dict_entries; + std::vector dict_entries; for (size_t i = 0; i < _num_children; ++i) { - dict_entries.push_back(_helper.dwa().lookup(vespalib::make_string("%zu", i).c_str(), _helper.dwa().get_dictionary_snapshot())); + dict_entries.push_back(_helper.dww().lookup(vespalib::make_string("%zu", i).c_str(), _helper.dww().get_dictionary_snapshot())); } - return create_wand(_use_dwa, _tfmd, match_params, _weights, dict_entries, _helper.dwa(), strict); + return create_wand(_use_dww, _tfmd, match_params, _weights, dict_entries, _helper.dww(), strict); } - bool _use_dwa; + bool _use_dww; mutable DummyHeap _dummy_heap; }; TEST("verify search iterator conformance") { - for (bool use_dwa: {false, true}) { - Verifier verifier(use_dwa); + for (bool use_dww: {false, true}) { + Verifier verifier(use_dww); verifier.verify(); } } diff --git a/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp b/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp index fed4e7c9bbd..837d7c026d4 100644 --- a/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp +++ b/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp @@ -289,7 +289,7 @@ private: } }; -class WeightIteratorChildrenVerifier : public search::test::DwaIteratorChildrenVerifier { +class WeightIteratorChildrenVerifier : public search::test::DwwIteratorChildrenVerifier { private: SearchIterator::UP create(std::vector && children) const override { return WeightedSetTermSearch::create(_tfmd, false, _weights, std::move(children)); -- cgit v1.2.3 From 6d19a414926742a1be4c6d591a8d5c2c93e9f939 Mon Sep 17 00:00:00 2001 From: Geir Storli Date: Thu, 23 Nov 2023 14:47:07 +0000 Subject: Rename DocumentWeightIterator to DocidWithWeightIterator. --- .../document_weight_iterator/document_weight_iterator_test.cpp | 4 ++-- searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp | 2 +- .../src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp | 2 +- .../src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp | 2 +- .../src/vespa/searchlib/attribute/direct_weighted_set_blueprint.hpp | 4 ++-- .../vespa/searchlib/attribute/document_weight_or_filter_search.cpp | 2 +- .../src/vespa/searchlib/attribute/document_weight_or_filter_search.h | 2 +- searchlib/src/vespa/searchlib/attribute/i_direct_posting_store.h | 2 +- .../src/vespa/searchlib/attribute/i_docid_with_weight_posting_store.h | 4 ++-- searchlib/src/vespa/searchlib/attribute/iterator_pack.cpp | 2 +- searchlib/src/vespa/searchlib/attribute/iterator_pack.h | 4 ++-- searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h | 4 ++-- searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp | 4 ++-- searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h | 4 ++-- searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp | 4 ++-- .../src/vespa/searchlib/queryeval/document_weight_search_iterator.h | 2 +- searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp | 2 +- searchlib/src/vespa/searchlib/queryeval/dot_product_search.h | 2 +- searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h | 2 +- searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp | 2 +- searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.h | 2 +- searchlib/src/vespa/searchlib/test/weightedchildrenverifiers.h | 4 ++-- 22 files changed, 31 insertions(+), 31 deletions(-) (limited to 'searchlib/src/tests') diff --git a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp index e2864773c96..28416d09d6f 100644 --- a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp +++ b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp @@ -127,11 +127,11 @@ TEST_F("require string lookup works correctly", StringFixture) { void verify_posting(const IDocidWithWeightPostingStore &api, const char *term) { auto result = api.lookup(term, api.get_dictionary_snapshot()); ASSERT_TRUE(result.posting_idx.valid()); - std::vector itr_store; + std::vector itr_store; api.create(result.posting_idx, itr_store); ASSERT_EQUAL(1u, itr_store.size()); { - DocumentWeightIterator &itr = itr_store[0]; + DocidWithWeightIterator &itr = itr_store[0]; if (itr.valid() && itr.getKey() < 1) { itr.linearSeek(1); } diff --git a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp index ed74ae101f3..357065d8667 100644 --- a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp +++ b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp @@ -277,7 +277,7 @@ private: class WeightIteratorChildrenVerifier : public search::test::DwwIteratorChildrenVerifier { private: SearchIterator::UP - create(std::vector && children) const override { + create(std::vector && children) const override { return DotProductSearch::create(_tfmd, false, _weights, std::move(children)); } }; diff --git a/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp b/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp index 837d7c026d4..fffa4b3c5ba 100644 --- a/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp +++ b/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp @@ -291,7 +291,7 @@ private: class WeightIteratorChildrenVerifier : public search::test::DwwIteratorChildrenVerifier { private: - SearchIterator::UP create(std::vector && children) const override { + SearchIterator::UP create(std::vector && children) const override { return WeightedSetTermSearch::create(_tfmd, false, _weights, std::move(children)); } }; diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp index 10f5afd5bb8..7cb69590d73 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp @@ -463,7 +463,7 @@ std::unique_ptr DirectWandBlueprint::createFilterSearch(bool, FilterConstraint constraint) const { if (constraint == Blueprint::FilterConstraint::UPPER_BOUND) { - std::vector iterators; + std::vector iterators; iterators.reserve(_terms.size()); for (const IDirectPostingStore::LookupResult &r : _terms) { _attr.create(r.posting_idx, iterators); diff --git a/searchlib/src/vespa/searchlib/attribute/direct_weighted_set_blueprint.hpp b/searchlib/src/vespa/searchlib/attribute/direct_weighted_set_blueprint.hpp index e55c5836b0a..4e754780d54 100644 --- a/searchlib/src/vespa/searchlib/attribute/direct_weighted_set_blueprint.hpp +++ b/searchlib/src/vespa/searchlib/attribute/direct_weighted_set_blueprint.hpp @@ -39,7 +39,7 @@ DirectWeightedSetBlueprint::createLeafSearch(const fef::TermFieldMat if (_terms.empty()) { return std::make_unique(); } - std::vector iterators; + std::vector iterators; const size_t numChildren = _terms.size(); iterators.reserve(numChildren); for (const IDirectPostingStore::LookupResult &r : _terms) { @@ -56,7 +56,7 @@ template std::unique_ptr DirectWeightedSetBlueprint::createFilterSearch(bool, FilterConstraint) const { - std::vector iterators; + std::vector iterators; iterators.reserve(_terms.size()); for (const IDirectPostingStore::LookupResult &r : _terms) { _attr.create(r.posting_idx, iterators); diff --git a/searchlib/src/vespa/searchlib/attribute/document_weight_or_filter_search.cpp b/searchlib/src/vespa/searchlib/attribute/document_weight_or_filter_search.cpp index ff2fe43d941..7ae7a24b80f 100644 --- a/searchlib/src/vespa/searchlib/attribute/document_weight_or_filter_search.cpp +++ b/searchlib/src/vespa/searchlib/attribute/document_weight_or_filter_search.cpp @@ -86,7 +86,7 @@ DocumentWeightOrFilterSearchImpl::doSeek(uint32_t docId) } std::unique_ptr -DocumentWeightOrFilterSearch::create(std::vector&& children) +DocumentWeightOrFilterSearch::create(std::vector&& children) { if (children.empty()) { return std::make_unique(); diff --git a/searchlib/src/vespa/searchlib/attribute/document_weight_or_filter_search.h b/searchlib/src/vespa/searchlib/attribute/document_weight_or_filter_search.h index ff8ae6dddda..cea30e83619 100644 --- a/searchlib/src/vespa/searchlib/attribute/document_weight_or_filter_search.h +++ b/searchlib/src/vespa/searchlib/attribute/document_weight_or_filter_search.h @@ -15,7 +15,7 @@ class DocumentWeightOrFilterSearch : public queryeval::SearchIterator protected: DocumentWeightOrFilterSearch() = default; public: - static std::unique_ptr create(std::vector&& children); + static std::unique_ptr create(std::vector&& children); static std::unique_ptr create(const std::vector& children, std::unique_ptr md); }; diff --git a/searchlib/src/vespa/searchlib/attribute/i_direct_posting_store.h b/searchlib/src/vespa/searchlib/attribute/i_direct_posting_store.h index 6b92a93d12c..1d26f3ef202 100644 --- a/searchlib/src/vespa/searchlib/attribute/i_direct_posting_store.h +++ b/searchlib/src/vespa/searchlib/attribute/i_direct_posting_store.h @@ -10,7 +10,7 @@ namespace search::queryeval { class SearchIterator; } namespace search { -using DocumentWeightIterator = attribute::PostingListTraits::const_iterator; +using DocidWithWeightIterator = attribute::PostingListTraits::const_iterator; /** * Baseline interface providing access to dictionary lookups and underlying posting lists for an attribute vector. diff --git a/searchlib/src/vespa/searchlib/attribute/i_docid_with_weight_posting_store.h b/searchlib/src/vespa/searchlib/attribute/i_docid_with_weight_posting_store.h index fc56c9d07e4..ae2ff2f3177 100644 --- a/searchlib/src/vespa/searchlib/attribute/i_docid_with_weight_posting_store.h +++ b/searchlib/src/vespa/searchlib/attribute/i_docid_with_weight_posting_store.h @@ -13,8 +13,8 @@ namespace search { */ class IDocidWithWeightPostingStore : public IDirectPostingStore { public: - virtual void create(vespalib::datastore::EntryRef idx, std::vector &dst) const = 0; - virtual DocumentWeightIterator create(vespalib::datastore::EntryRef idx) const = 0; + virtual void create(vespalib::datastore::EntryRef idx, std::vector &dst) const = 0; + virtual DocidWithWeightIterator create(vespalib::datastore::EntryRef idx) const = 0; }; } diff --git a/searchlib/src/vespa/searchlib/attribute/iterator_pack.cpp b/searchlib/src/vespa/searchlib/attribute/iterator_pack.cpp index 3dda6017e0a..7f40a38fc7f 100644 --- a/searchlib/src/vespa/searchlib/attribute/iterator_pack.cpp +++ b/searchlib/src/vespa/searchlib/attribute/iterator_pack.cpp @@ -8,7 +8,7 @@ namespace search { AttributeIteratorPack::~AttributeIteratorPack() = default; -AttributeIteratorPack::AttributeIteratorPack(std::vector &&children) +AttributeIteratorPack::AttributeIteratorPack(std::vector &&children) : _children(std::move(children)) { assert(_children.size() <= std::numeric_limits::max()); diff --git a/searchlib/src/vespa/searchlib/attribute/iterator_pack.h b/searchlib/src/vespa/searchlib/attribute/iterator_pack.h index 7b91156c71e..3d2bedc7b3a 100644 --- a/searchlib/src/vespa/searchlib/attribute/iterator_pack.h +++ b/searchlib/src/vespa/searchlib/attribute/iterator_pack.h @@ -12,7 +12,7 @@ class BitVector; class AttributeIteratorPack { private: - std::vector _children; + std::vector _children; public: using ref_t = uint16_t; @@ -20,7 +20,7 @@ public: AttributeIteratorPack(AttributeIteratorPack &&rhs) noexcept = default; AttributeIteratorPack &operator=(AttributeIteratorPack &&rhs) noexcept = default; - explicit AttributeIteratorPack(std::vector &&children); + explicit AttributeIteratorPack(std::vector &&children); ~AttributeIteratorPack(); uint32_t get_docid(ref_t ref) const { diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h index 39f58c83410..2775f8e4947 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h @@ -39,8 +39,8 @@ private: vespalib::datastore::EntryRef get_dictionary_snapshot() const override; LookupResult lookup(const LookupKey & key, vespalib::datastore::EntryRef dictionary_snapshot) const override; void collect_folded(vespalib::datastore::EntryRef enum_idx, vespalib::datastore::EntryRef dictionary_snapshot, const std::function& callback) const override; - void create(vespalib::datastore::EntryRef idx, std::vector &dst) const override; - DocumentWeightIterator create(vespalib::datastore::EntryRef idx) const override; + void create(vespalib::datastore::EntryRef idx, std::vector &dst) const override; + DocidWithWeightIterator create(vespalib::datastore::EntryRef idx) const override; std::unique_ptr make_bitvector_iterator(vespalib::datastore::EntryRef idx, uint32_t doc_id_limit, fef::TermFieldMatchData &match_data, bool strict) const override; bool has_weight_iterator(vespalib::datastore::EntryRef idx) const noexcept override; }; diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp index 0bc1f6bc5a4..b0ca9f7658f 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp @@ -124,14 +124,14 @@ MultiValueNumericPostingAttribute::DocidWithWeightPostingStoreAdapter::col template void -MultiValueNumericPostingAttribute::DocidWithWeightPostingStoreAdapter::create(vespalib::datastore::EntryRef idx, std::vector &dst) const +MultiValueNumericPostingAttribute::DocidWithWeightPostingStoreAdapter::create(vespalib::datastore::EntryRef idx, std::vector &dst) const { assert(idx.valid()); self.get_posting_store().beginFrozen(idx, dst); } template -DocumentWeightIterator +DocidWithWeightIterator MultiValueNumericPostingAttribute::DocidWithWeightPostingStoreAdapter::create(vespalib::datastore::EntryRef idx) const { assert(idx.valid()); diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h index 266e7e7a9ee..bd7cb7b5497 100644 --- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h @@ -37,8 +37,8 @@ private: vespalib::datastore::EntryRef get_dictionary_snapshot() const override; LookupResult lookup(const LookupKey & key, vespalib::datastore::EntryRef dictionary_snapshot) const override; void collect_folded(vespalib::datastore::EntryRef enum_idx, vespalib::datastore::EntryRef dictionary_snapshot, const std::function& callback) const override; - void create(vespalib::datastore::EntryRef idx, std::vector &dst) const override; - DocumentWeightIterator create(vespalib::datastore::EntryRef idx) const override; + void create(vespalib::datastore::EntryRef idx, std::vector &dst) const override; + DocidWithWeightIterator create(vespalib::datastore::EntryRef idx) const override; std::unique_ptr make_bitvector_iterator(vespalib::datastore::EntryRef idx, uint32_t doc_id_limit, fef::TermFieldMatchData &match_data, bool strict) const override; bool has_weight_iterator(vespalib::datastore::EntryRef idx) const noexcept override; }; diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp index bcdd34ea547..a6d967d1646 100644 --- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp @@ -144,14 +144,14 @@ MultiValueStringPostingAttributeT::DocidWithWeightPostingStoreAdapter::col template void -MultiValueStringPostingAttributeT::DocidWithWeightPostingStoreAdapter::create(vespalib::datastore::EntryRef idx, std::vector &dst) const +MultiValueStringPostingAttributeT::DocidWithWeightPostingStoreAdapter::create(vespalib::datastore::EntryRef idx, std::vector &dst) const { assert(idx.valid()); self.get_posting_store().beginFrozen(idx, dst); } template -DocumentWeightIterator +DocidWithWeightIterator MultiValueStringPostingAttributeT::DocidWithWeightPostingStoreAdapter::create(vespalib::datastore::EntryRef idx) const { assert(idx.valid()); diff --git a/searchlib/src/vespa/searchlib/queryeval/document_weight_search_iterator.h b/searchlib/src/vespa/searchlib/queryeval/document_weight_search_iterator.h index a3fa102f7b8..448f1c8f2b4 100644 --- a/searchlib/src/vespa/searchlib/queryeval/document_weight_search_iterator.h +++ b/searchlib/src/vespa/searchlib/queryeval/document_weight_search_iterator.h @@ -13,7 +13,7 @@ class DocumentWeightSearchIterator : public SearchIterator private: fef::TermFieldMatchData &_tfmd; fef::TermFieldMatchDataPosition * _matchPosition; - DocumentWeightIterator _iterator; + DocidWithWeightIterator _iterator; queryeval::MinMaxPostingInfo _postingInfo; public: diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp index fc5057b6a8d..8f4df612023 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp @@ -179,7 +179,7 @@ SearchIterator::UP DotProductSearch::create(TermFieldMatchData &tmd, bool field_is_filter, const std::vector &weights, - std::vector &&iterators) + std::vector &&iterators) { using ArrayHeapImpl = DotProductSearchImpl; using HeapImpl = DotProductSearchImpl; diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h index 34e288979e0..d06ea9439d2 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h @@ -36,7 +36,7 @@ public: static SearchIterator::UP create(search::fef::TermFieldMatchData &tmd, bool field_is_filter, const std::vector &weights, - std::vector &&iterators); + std::vector &&iterators); }; } diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h b/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h index 99651c422bc..84fd2eb0d9e 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h @@ -273,7 +273,7 @@ struct VectorizedAttributeTerms : VectorizedState { docid_t docIdLimit) { std::vector order = init_state(AttrInput(weights, dict_entries), docIdLimit); - std::vector iterators; + std::vector iterators; iterators.reserve(order.size()); for (size_t i = 0; i < order.size(); ++i) { attr.create(dict_entries[order[i]].posting_idx, iterators); diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp index 32ae321e031..9e58cd489ac 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp @@ -188,7 +188,7 @@ SearchIterator::UP WeightedSetTermSearch::create(fef::TermFieldMatchData &tmd, bool field_is_filter, const std::vector &weights, - std::vector &&iterators) + std::vector &&iterators) { using ArrayHeapImpl = WeightedSetTermSearchImpl; using HeapImpl = WeightedSetTermSearchImpl; diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.h b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.h index 6cda16a677c..17239391df8 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.h @@ -36,7 +36,7 @@ public: static SearchIterator::UP create(search::fef::TermFieldMatchData &tmd, bool field_is_filter, const std::vector &weights, - std::vector &&iterators); + std::vector &&iterators); // used during docsum fetching to identify matching elements // initRange must be called before use. diff --git a/searchlib/src/vespa/searchlib/test/weightedchildrenverifiers.h b/searchlib/src/vespa/searchlib/test/weightedchildrenverifiers.h index 715de6461e7..86d2fb9aa67 100644 --- a/searchlib/src/vespa/searchlib/test/weightedchildrenverifiers.h +++ b/searchlib/src/vespa/searchlib/test/weightedchildrenverifiers.h @@ -62,7 +62,7 @@ public: ~DwwIteratorChildrenVerifier() override {} SearchIterator::UP create(bool strict) const override { (void) strict; - std::vector children; + std::vector children; for (size_t i = 0; i < _num_children; ++i) { auto dict_entry = _helper.dww().lookup(vespalib::make_string("%zu", i).c_str(), _helper.dww().get_dictionary_snapshot()); _helper.dww().create(dict_entry.posting_idx, children); @@ -70,7 +70,7 @@ public: return create(std::move(children)); } protected: - virtual SearchIterator::UP create(std::vector &&) const { + virtual SearchIterator::UP create(std::vector &&) const { return {}; } DocumentWeightAttributeHelper _helper; -- cgit v1.2.3