diff options
author | Lester Solbakken <lesters@oath.com> | 2018-09-05 21:51:57 +0200 |
---|---|---|
committer | Lester Solbakken <lesters@oath.com> | 2018-09-05 21:51:57 +0200 |
commit | f41d2b1147f4fdf11c9a7df2a256823cd46e0048 (patch) | |
tree | d51f8ff756ffceb02350268de5cd9861349dc322 /searchcore | |
parent | ae9d491d6da4200231b12df1670355070866ec75 (diff) |
Don't repeat rerank-count override
Diffstat (limited to 'searchcore')
5 files changed, 6 insertions, 7 deletions
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp index de6a452baf3..4813bf3bdc7 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -287,7 +287,7 @@ struct MyWorld { Matcher::SP matcher = createMatcher(); search::fef::Properties overrides; auto mtf = matcher->create_match_tools_factory(*req, searchContext, attributeContext, metaStore, overrides); - auto diversity = mtf->createDiversifier(); + auto diversity = mtf->createDiversifier(search::fef::indexproperties::hitcollector::HeapSize::lookup(config)); EXPECT_EQUAL(expectDiverse, static_cast<bool>(diversity)); } diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp index d974be1ce3a..4d49e9b5d1b 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp @@ -64,7 +64,7 @@ MatchMaster::match(const MatchParams ¶ms, fastos::StopWatch query_latency_time; query_latency_time.start(); vespalib::DualMergeDirector mergeDirector(threadBundle.size()); - MatchLoopCommunicator communicator(threadBundle.size(), params.heapSize, mtf.createDiversifier()); + MatchLoopCommunicator communicator(threadBundle.size(), params.heapSize, mtf.createDiversifier(params.heapSize)); TimedMatchLoopCommunicator timedCommunicator(communicator); DocidRangeScheduler::UP scheduler = createScheduler(threadBundle.size(), numSearchPartitions, params.numDocs); diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp index 4c04c23b35b..28d56b7e0a2 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp @@ -204,7 +204,7 @@ MatchToolsFactory::createMatchTools() const } std::unique_ptr<IDiversifier> -MatchToolsFactory::createDiversifier() const +MatchToolsFactory::createDiversifier(uint32_t heapSize) const { if ( !_diversityParams.enabled() ) { return std::unique_ptr<IDiversifier>(); @@ -214,7 +214,6 @@ MatchToolsFactory::createDiversifier() const LOG(warning, "Skipping diversity due to no %s attribute.", _diversityParams.attribute.c_str()); return std::unique_ptr<IDiversifier>(); } - uint32_t heapSize = hitcollector::HeapSize::lookup(_queryEnv.getProperties(), _rankSetup.getHeapSize()); size_t max_per_group = heapSize/_diversityParams.min_groups; return DiversityFilter::create(*attr, heapSize, max_per_group, _diversityParams.min_groups, _diversityParams.cutoff_strategy == DiversityParams::CutoffStrategy::STRICT); diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h index 8f04eebc50e..0ecf6eb5b78 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h @@ -124,7 +124,7 @@ public: const MaybeMatchPhaseLimiter &match_limiter() const { return *_match_limiter; } MatchTools::UP createMatchTools() const; bool should_diversify() const { return _diversityParams.enabled(); } - std::unique_ptr<search::queryeval::IDiversifier> createDiversifier() const; + std::unique_ptr<search::queryeval::IDiversifier> createDiversifier(uint32_t heapSize) const; search::queryeval::Blueprint::HitEstimate estimate() const { return _query.estimate(); } bool has_first_phase_rank() const { return !_rankSetup.getFirstPhaseRank().empty(); } std::unique_ptr<AttributeOperationTask> createOnMatchTask() const; diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 94159d0bf2a..13562c4e45a 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -19,7 +19,6 @@ LOG_SETUP(".proton.matching.matcher"); using search::fef::Properties; -using namespace search::fef::indexproperties; using namespace search::fef::indexproperties::matching; using namespace search::engine; using namespace search::grouping; @@ -244,7 +243,8 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl } const Properties & rankProperties = request.propertiesMap.rankProperties(); - uint32_t heapSize = hitcollector::HeapSize::lookup(rankProperties, _rankSetup->getHeapSize()); + uint32_t heapSize = search::fef::indexproperties::hitcollector:: HeapSize::lookup(rankProperties, + _rankSetup->getHeapSize()); MatchParams params(searchContext.getDocIdLimit(), heapSize, _rankSetup->getArraySize(), _rankSetup->getRankScoreDropLimit(), request.offset, request.maxhits, |