summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-01-13 13:11:55 +0100
committerGitHub <noreply@github.com>2017-01-13 13:11:55 +0100
commitf9a87058b674129852a39696d825492a3b424f74 (patch)
treef3171a7a69581108d7fa1c6bead41413c7b0d12e /searchcore
parent6c459a633f61bf9b90df501539cd19ec608303d5 (diff)
parent0914962c28ce2d609433c7ebcdeb7844a2dbbc64 (diff)
Merge pull request #1507 from yahoo/balder/fix-slow-initrange-with-long-iterator
Init range quickly to the first document to look for.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_master.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
index 1022b487f19..40b05001a2e 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
@@ -108,6 +108,9 @@ FeatureSet::SP
MatchMaster::getFeatureSet(const MatchToolsFactory &matchToolsFactory,
const std::vector<uint32_t> &docs, bool summaryFeatures)
{
+ if (docs.empty()) {
+ return std::make_shared<FeatureSet>();
+ }
MatchTools::UP matchTools = matchToolsFactory.createMatchTools();
RankProgram::UP rankProgram = summaryFeatures ? matchTools->summary_program() :
matchTools->dump_program();
@@ -122,7 +125,7 @@ MatchMaster::getFeatureSet(const MatchToolsFactory &matchToolsFactory,
FeatureSet &fs = *retval.get();
SearchIterator::UP search = matchTools->createSearch(rankProgram->match_data());
- search->initFullRange();
+ search->initRange(docs.front(), docs.back()+1);
for (uint32_t i = 0; i < docs.size(); ++i) {
if (search->seek(docs[i])) {
uint32_t docId = search->getDocId();