diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-11-07 13:10:16 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-11-07 13:10:16 +0000 |
commit | 0207f8754280121f47e6b3b183e3bdc9ecc27f89 (patch) | |
tree | 2bee08645276f7c37b506c8fcd00232e7d4315ba /searchcore/src/tests/proton | |
parent | 8e983a117284a7e965e27e3a5c0a07cdbcb7d4cd (diff) |
If match-phase limiting has concluded that a post filter is most efficient,
we must only generate posting lists if it is actually benefiscal. If not the fixed cost is too high.
Diffstat (limited to 'searchcore/src/tests/proton')
-rw-r--r-- | searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp index 9f4edac9ba4..21c572995d3 100644 --- a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp +++ b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp @@ -181,6 +181,7 @@ TEST("require that max group size is calculated correctly") { TEST("require that the attribute limiter works correctly") { FakeRequestContext requestContext; MockRangeLocator rangeLocator; + constexpr double HIT_RATE = 0.1; for (int i = 0; i <= 7; ++i) { bool descending = (i & 1) != 0; bool strict = (i & 2) != 0; @@ -190,10 +191,10 @@ TEST("require that the attribute limiter works correctly") { "category", 10.0, AttributeLimiter::LOOSE); EXPECT_EQUAL(0u, searchable.create_cnt); EXPECT_FALSE(limiter.was_used()); - SearchIterator::UP s1 = limiter.create_search(42, diverse ? 3 : 42, strict); + SearchIterator::UP s1 = limiter.create_search(42, diverse ? 3 : 42, HIT_RATE, strict); EXPECT_TRUE(limiter.was_used()); EXPECT_EQUAL(1u, searchable.create_cnt); - SearchIterator::UP s2 = limiter.create_search(42, diverse ? 3 : 42, strict); + SearchIterator::UP s2 = limiter.create_search(42, diverse ? 3 : 42, HIT_RATE, strict); EXPECT_EQUAL(1u, searchable.create_cnt); auto *ms = dynamic_cast<MockSearch*>(s1.get()); ASSERT_TRUE(ms != nullptr); |