diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-01 21:41:30 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-01 21:41:30 +0000 |
commit | 4f5be349db2d4bef3f53be62fd7cbee9f8a8b9cd (patch) | |
tree | dab67ff4751470007081b5671adb47ce187aa846 /searchlib/src/tests/attribute/imported_search_context | |
parent | ce77fff993f6bab999bcf70cdcc255dbeb161d19 (diff) |
Consider estimated hitrate.
Diffstat (limited to 'searchlib/src/tests/attribute/imported_search_context')
-rw-r--r-- | searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp | 18 |
1 files changed, 18 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 1db013aaef3..53ad14f3c28 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 @@ -218,6 +218,24 @@ TEST_F("Strict iterator is marked as strict", Fixture) { EXPECT_TRUE(iter->is_strict() == Trinary::True); // No EXPECT_EQUALS printing of Trinary... } +TEST_F("Non-strict blueprint with high hit rate is strict", Fixture) { + auto ctx = f.create_context(word_term("5678")); + ctx->fetchPostings(queryeval::ExecuteInfo::create(false, 0.02)); + TermFieldMatchData match; + auto iter = f.create_iterator(*ctx, match, false); + + EXPECT_TRUE(iter->is_strict() == Trinary::True); +} + +TEST_F("Non-strict blueprint with low hit rate is non-strict", Fixture) { + auto ctx = f.create_context(word_term("5678")); + ctx->fetchPostings(queryeval::ExecuteInfo::create(false, 0.01)); + TermFieldMatchData match; + auto iter = f.create_iterator(*ctx, match, false); + + EXPECT_TRUE(iter->is_strict() == Trinary::False); +} + struct SingleValueFixture : Fixture { SingleValueFixture() { reset_with_single_value_reference_mappings<IntegerAttribute, int32_t>( |