diff options
author | Henning Baldersheim <balder@oath.com> | 2018-08-10 11:41:21 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-08-10 11:41:21 +0200 |
commit | 7ea387672dee635177044cc3e3f6d2d5bc7940d1 (patch) | |
tree | 7a99a7e8c8aa1e22357c9c4458c6d8ebb0b03abd /searchcore/src/tests/proton/matching/matching_test.cpp | |
parent | a69d3fbc52267773b93eab46a25b20cde142ce34 (diff) |
Separate test to be more clear what is being tested.
Diffstat (limited to 'searchcore/src/tests/proton/matching/matching_test.cpp')
-rw-r--r-- | searchcore/src/tests/proton/matching/matching_test.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp index ef60a375a5c..c7ea75f50d6 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -545,8 +545,7 @@ TEST("require that re-ranking is performed (multi-threaded)") { } } -using namespace search::fef::indexproperties::matchphase; -TEST("require that re-ranking is diverse") { +TEST("require that re-ranking is not diverse when not requested to be.") { MyWorld world; world.basicSetup(); world.setupSecondPhaseRanking(); @@ -555,12 +554,22 @@ TEST("require that re-ranking is diverse") { auto mtf = world.create_mtf(request); auto diversity = mtf->createDiversifier(); EXPECT_FALSE(diversity); +} + +using namespace search::fef::indexproperties::matchphase; +TEST("require that re-ranking is diverse with diversity = 1/1") { + MyWorld world; + world.basicSetup(); + world.setupSecondPhaseRanking(); + world.basicResults(); + SearchRequest::SP request = world.createSimpleRequest("f1", "spread"); + auto mtf = world.create_mtf(request); auto & rankProperies = request->propertiesMap.lookupCreate(MapNames::RANK); rankProperies.add(DiversityAttribute::NAME, "a2") .add(DiversityMinGroups::NAME, "3") .add(DiversityCutoffStrategy::NAME, "strict"); mtf = world.create_mtf(request); - diversity = mtf->createDiversifier(); + auto diversity = mtf->createDiversifier(); EXPECT_TRUE(diversity); SearchReply::UP reply = world.performSearch(request, 1); EXPECT_EQUAL(9u, world.matchingStats.docsMatched()); @@ -581,7 +590,7 @@ TEST("require that re-ranking is diverse") { EXPECT_GREATER(world.matchingStats.rerankTimeAvg(), 0.0000001); } -TEST("require that re-ranking is forced diverse") { +TEST("require that re-ranking is diverse with diversity = 1/10") { MyWorld world; world.basicSetup(); world.setupSecondPhaseRanking(); |