summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2023-11-23 16:30:02 +0100
committerGitHub <noreply@github.com>2023-11-23 16:30:02 +0100
commitdd94d619668210d09792597cbd218994058e923e (patch)
tree08cc40f74d66e200b8bcc58a2d08cceb4594889f /searchlib/src/tests
parent3cae52a5ab51ecf162f0eaa048615ba9b6c607cb (diff)
parent6d19a414926742a1be4c6d591a8d5c2c93e9f939 (diff)
Merge pull request #29448 from vespa-engine/geirst/refactor-apis-for-posting-list-access
Refactor apis for attribute posting list access
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r--searchlib/src/tests/attribute/bitvector/bitvector_test.cpp26
-rw-r--r--searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp60
-rw-r--r--searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp4
-rw-r--r--searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp2
-rw-r--r--searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp4
-rw-r--r--searchlib/src/tests/queryeval/matching_elements_search/matching_elements_search_test.cpp20
-rw-r--r--searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp43
-rw-r--r--searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp4
9 files changed, 82 insertions, 83 deletions
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 <vespa/vespalib/testkit/testapp.h>
-
+#include <vespa/searchcommon/attribute/config.h>
#include <vespa/searchlib/attribute/attribute.h>
#include <vespa/searchlib/attribute/attributefactory.h>
-#include <vespa/searchlib/util/randomgenerator.h>
-#include <vespa/vespalib/util/compress.h>
+#include <vespa/searchlib/attribute/i_docid_with_weight_posting_store.h>
+#include <vespa/searchlib/common/bitvectoriterator.h>
#include <vespa/searchlib/fef/termfieldmatchdata.h>
-#include <vespa/searchlib/attribute/i_document_weight_attribute.h>
+#include <vespa/searchlib/parsequery/parse.h>
#include <vespa/searchlib/queryeval/document_weight_search_iterator.h>
-#include <vespa/searchlib/test/searchiteratorverifier.h>
-#include <vespa/searchlib/common/bitvectoriterator.h>
#include <vespa/searchlib/queryeval/executeinfo.h>
-#include <vespa/searchlib/parsequery/parse.h>
-#include <vespa/searchcommon/attribute/config.h>
+#include <vespa/searchlib/test/searchiteratorverifier.h>
+#include <vespa/searchlib/util/randomgenerator.h>
#include <vespa/vespalib/stllike/asciistream.h>
+#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/util/compress.h>
#include <vespa/log/log.h>
-
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<VectorType>(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<VectorType>(), dwa->get_dictionary_snapshot());
+ const auto* dww = v->as_docid_with_weight_posting_store();
+ if (dww != nullptr) {
+ auto lres = dww->lookup(getSearchStr<VectorType>(), dww->get_dictionary_snapshot());
using DWSI = search::queryeval::DocumentWeightSearchIterator;
TermFieldMatchData md;
- auto dwsi = std::make_unique<DWSI>(md, *dwa, lres);
+ auto dwsi = std::make_unique<DWSI>(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..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
@@ -1,18 +1,18 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/searchcommon/attribute/config.h>
#include <vespa/searchlib/attribute/attribute.h>
+#include <vespa/searchlib/attribute/attribute_read_guard.h>
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/attributeguard.h>
-#include <vespa/searchlib/attribute/attribute_read_guard.h>
#include <vespa/searchlib/attribute/attributememorysavetarget.h>
-#include <vespa/searchlib/attribute/i_document_weight_attribute.h>
+#include <vespa/searchlib/attribute/i_docid_with_weight_posting_store.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/queryeval/document_weight_search_iterator.h>
#include <vespa/searchlib/test/searchiteratorverifier.h>
#include <vespa/searchlib/util/randomgenerator.h>
-#include <vespa/searchcommon/attribute/config.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/test/insertion_operators.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
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,14 +124,14 @@ 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<DocumentWeightIterator> itr_store;
+ std::vector<DocidWithWeightIterator> 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);
}
@@ -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 <vespa/vespalib/gtest/gtest.h>
-#include <vespa/searchlib/attribute/i_document_weight_attribute.h>
+#include <vespa/searchlib/attribute/i_direct_posting_store.h>
#include <vespa/searchlib/attribute/document_weight_or_filter_search.h>
#include <vespa/searchlib/queryeval/searchiterator.h>
#include <vespa/searchlib/common/bitvector.h>
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..357065d8667 100644
--- a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp
+++ b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp
@@ -274,10 +274,10 @@ private:
}
};
-class WeightIteratorChildrenVerifier : public search::test::DwaIteratorChildrenVerifier {
+class WeightIteratorChildrenVerifier : public search::test::DwwIteratorChildrenVerifier {
private:
SearchIterator::UP
- create(std::vector<DocumentWeightIterator> && children) const override {
+ create(std::vector<DocidWithWeightIterator> && children) const override {
return DotProductSearch::create(_tfmd, false, _weights, std::move(children));
}
};
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 <vespa/searchcommon/attribute/attributecontent.h>
+#include <vespa/searchcommon/attribute/config.h>
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/attributevector.h>
-#include <vespa/searchlib/attribute/stringbase.h>
+#include <vespa/searchlib/attribute/i_docid_with_weight_posting_store.h>
#include <vespa/searchlib/attribute/integerbase.h>
-#include <vespa/searchlib/attribute/i_document_weight_attribute.h>
+#include <vespa/searchlib/attribute/stringbase.h>
#include <vespa/searchlib/common/matching_elements.h>
#include <vespa/searchlib/queryeval/matching_elements_search.h>
-#include <vespa/searchcommon/attribute/config.h>
#include <vespa/vespalib/gtest/gtest.h>
-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<AttributeVector> make_attribute(BasicType type) {
Config cfg(type, CollectionType::WSET);
@@ -36,8 +36,8 @@ std::shared_ptr<AttributeVector> make_attribute(BasicType type) {
std::unique_ptr<MatchingElementsSearch> make_search(AttributeVector &attr, const std::vector<vespalib::string> &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<LookupResult> 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 <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/query/tree/simplequery.h>
-#include <vespa/searchlib/queryeval/fake_searchable.h>
+#include <vespa/searchlib/queryeval/document_weight_search_iterator.h>
#include <vespa/searchlib/queryeval/fake_requestcontext.h>
-#include <vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h>
-#include <vespa/searchlib/queryeval/wand/parallel_weak_and_search.h>
+#include <vespa/searchlib/queryeval/fake_searchable.h>
#include <vespa/searchlib/queryeval/simpleresult.h>
#include <vespa/searchlib/queryeval/test/eagerchild.h>
#include <vespa/searchlib/queryeval/test/leafspec.h>
#include <vespa/searchlib/queryeval/test/wandspec.h>
-#include <vespa/searchlib/test/weightedchildrenverifiers.h>
+#include <vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h>
+#include <vespa/searchlib/queryeval/wand/parallel_weak_and_search.h>
#include <vespa/searchlib/test/document_weight_attribute_helper.h>
-#include <vespa/searchlib/queryeval/document_weight_search_iterator.h>
+#include <vespa/searchlib/test/weightedchildrenverifiers.h>
+#include <vespa/vespalib/testkit/test_kit.h>
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<score_t>
@@ -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<int32_t> &weights,
- const std::vector<IDocumentWeightAttribute::LookupResult> &dict_entries,
- const IDocumentWeightAttribute &attr,
+ const std::vector<IDirectPostingStore::LookupResult> &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<IDocumentWeightAttribute::LookupResult> dict_entries;
+ std::vector<IDirectPostingStore::LookupResult> 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..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
@@ -289,9 +289,9 @@ private:
}
};
-class WeightIteratorChildrenVerifier : public search::test::DwaIteratorChildrenVerifier {
+class WeightIteratorChildrenVerifier : public search::test::DwwIteratorChildrenVerifier {
private:
- SearchIterator::UP create(std::vector<DocumentWeightIterator> && children) const override {
+ SearchIterator::UP create(std::vector<DocidWithWeightIterator> && children) const override {
return WeightedSetTermSearch::create(_tfmd, false, _weights, std::move(children));
}
};