summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/matching/matching_test.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-08-10 11:41:21 +0200
committerHenning Baldersheim <balder@oath.com>2018-08-10 11:41:21 +0200
commit7ea387672dee635177044cc3e3f6d2d5bc7940d1 (patch)
tree7a99a7e8c8aa1e22357c9c4458c6d8ebb0b03abd /searchcore/src/tests/proton/matching/matching_test.cpp
parenta69d3fbc52267773b93eab46a25b20cde142ce34 (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.cpp17
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();