aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
diff options
context:
space:
mode:
authorTor Egge <tegge@oath.com>2017-08-24 13:56:37 +0000
committerTor Egge <tegge@oath.com>2017-08-24 14:04:49 +0000
commit4ae4e98e2e20ecec9e33c3b7bfcb9a138fc1cd27 (patch)
tree694e8f4ec8644485d1e7acf727145026b9872111 /searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
parentb518de1959b98d9b7a977464e7c726e024a3c896 (diff)
If fetchPostings() is called with strict set to true then build
synthetic posting list based on reverse mapping and result of scanning target attribute (via target search context and corresponding search iterator). Use synthetic posting list if available when creating iterator.
Diffstat (limited to 'searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp')
-rw-r--r--searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp b/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
index 5811ca9cc4d..c9e0757ee16 100644
--- a/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
+++ b/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
@@ -197,6 +197,7 @@ TEST_F("Non-strict iterator unpacks target match data for weighted set hit", Wse
TEST_F("Strict iterator is marked as strict", Fixture) {
auto ctx = f.create_context(word_term("5678"));
+ ctx->fetchPostings(true);
TermFieldMatchData match;
auto iter = f.create_strict_iterator(*ctx, match);
@@ -218,11 +219,12 @@ struct SingleValueFixture : Fixture {
TEST_F("Strict iterator seeks to first available hit LID", SingleValueFixture) {
auto ctx = f.create_context(word_term("5678"));
+ ctx->fetchPostings(true);
TermFieldMatchData match;
auto iter = f.create_strict_iterator(*ctx, match);
EXPECT_FALSE(iter->isAtEnd());
- EXPECT_EQUAL(iter->beginId(), iter->getDocId());
+ EXPECT_EQUAL(DocId(3), iter->getDocId());
EXPECT_FALSE(iter->seek(DocId(1)));
EXPECT_FALSE(iter->isAtEnd());
@@ -243,6 +245,7 @@ TEST_F("Strict iterator seeks to first available hit LID", SingleValueFixture) {
TEST_F("Strict iterator unpacks target match data for single value hit", SingleValueFixture) {
auto ctx = f.create_context(word_term("5678"));
+ ctx->fetchPostings(true);
TermFieldMatchData match;
auto iter = f.create_strict_iterator(*ctx, match);
@@ -254,6 +257,7 @@ TEST_F("Strict iterator unpacks target match data for single value hit", SingleV
TEST_F("Strict iterator unpacks target match data for array hit", ArrayValueFixture) {
auto ctx = f.create_context(word_term("1234"));
+ ctx->fetchPostings(true);
TermFieldMatchData match;
auto iter = f.create_strict_iterator(*ctx, match);
@@ -265,6 +269,7 @@ TEST_F("Strict iterator unpacks target match data for array hit", ArrayValueFixt
TEST_F("Strict iterator unpacks target match data for weighted set hit", WsetValueFixture) {
auto ctx = f.create_context(word_term("foo"));
+ ctx->fetchPostings(true);
TermFieldMatchData match;
auto iter = f.create_strict_iterator(*ctx, match);
@@ -275,6 +280,7 @@ TEST_F("Strict iterator unpacks target match data for weighted set hit", WsetVal
TEST_F("Strict iterator handles seek outside of LID space", ArrayValueFixture) {
auto ctx = f.create_context(word_term("1234"));
+ ctx->fetchPostings(true);
TermFieldMatchData match;
auto iter = f.create_strict_iterator(*ctx, match);
@@ -306,6 +312,7 @@ TEST_F("cmp(weight) performs GID mapping and forwards to target attribute", Wset
TEST_F("Multiple iterators can be created from the same context", SingleValueFixture) {
auto ctx = f.create_context(word_term("5678"));
+ ctx->fetchPostings(true);
TermFieldMatchData match1;
auto iter1 = f.create_strict_iterator(*ctx, match1);