aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-04-25 15:14:03 +0200
committerTor Egge <Tor.Egge@online.no>2023-04-25 15:14:03 +0200
commitc3e9f699bb2d958937437c71e4f7d89192ab30f5 (patch)
tree6447813e626ff4d02a5aeed1b3836a6ab41df112 /searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
parentd5f17d23f377776e85aa687be17b211b54423c59 (diff)
Check target attribute lid range.
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.cpp13
1 files changed, 13 insertions, 0 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 847a992d241..fac1284f1a6 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
@@ -429,6 +429,19 @@ TEST_F("original lid range is used by search context", SingleValueFixture)
EXPECT_TRUE(second_ctx->matches(DocId(10)));
}
+TEST_F("Original target lid range is used by search context", SingleValueFixture)
+{
+ auto first_ctx = f.create_context(word_term("2345"));
+ add_n_docs_with_undefined_values(*f.target_attr, 1);
+ auto typed_target_attr = f.template target_attr_as<IntegerAttribute>();
+ ASSERT_TRUE(typed_target_attr->update(11, 2345));
+ f.target_attr->commit();
+ f.map_reference(DocId(8), dummy_gid(11), DocId(11));
+ auto second_ctx = f.create_context(word_term("2345"));
+ EXPECT_FALSE(first_ctx->matches(DocId(8)));
+ EXPECT_TRUE(second_ctx->matches(DocId(8)));
+}
+
// Note: this uses an underlying string attribute, as queryTerm() does not seem to
// implemented at all for (single) numeric attributes. Intentional?
TEST_F("queryTerm() returns term context was created with", WsetValueFixture) {