diff options
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp index 38336009f14..52d7d906d4c 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp @@ -68,22 +68,28 @@ fillPartialResult(ResultProcessor::Context & context, size_t totalHits, size_t n PartialResult &pr = *context.result; pr.totalHits(totalHits); size_t maxHits = std::min(numHits, pr.maxSize()); - //TODO :const search::BitVector & validLids = context._validLids; + const search::BitVector & validLids = context._validLids; if (pr.hasSortData()) { FastS_SortSpec &spec = context.sort->sortSpec; for (size_t i = 0; i < maxHits; ++i) { - pr.add(hits[i], spec.getSortRef(i)); + if (validLids.testBit(hits[i].getDocId())) { + pr.add(hits[i], spec.getSortRef(i)); + } } } else { for (size_t i = 0; i < maxHits; ++i) { - pr.add(hits[i]); + if (validLids.testBit(hits[i].getDocId())) { + pr.add(hits[i]); + } } if ((bits != nullptr) && (pr.size() < pr.maxSize())) { for (unsigned int bitId = bits->getFirstTrueBit(); (bitId < bits->size()) && (pr.size() < pr.maxSize()); bitId = bits->getNextTrueBit(bitId + 1)) { - pr.add(search::RankedHit(bitId)); + if (validLids.testBit(bitId)) { + pr.add(search::RankedHit(bitId)); + } } } } |