summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-06-30 16:40:17 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-06-30 16:40:17 +0000
commit17939b9d41278d9e2a6133a8d644d869a74ee27d (patch)
tree8f9207e145c25ce7f04c5add6063adaa07d44a92 /searchcore
parent13311c7b7d5cd1539cbe3c263b2a4daf0ceeef2f (diff)
Do not drop rank if rank-score-drop-limit has been specified explicit.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index b2d1593aafc..52130f40026 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -72,9 +72,9 @@ numThreads(size_t hits, size_t minHits) {
class LimitedThreadBundleWrapper final : public vespalib::ThreadBundle
{
public:
- LimitedThreadBundleWrapper(vespalib::ThreadBundle &threadBundle, uint32_t maxThreads) :
- _threadBundle(threadBundle),
- _maxThreads(std::min(maxThreads, static_cast<uint32_t>(threadBundle.size())))
+ LimitedThreadBundleWrapper(vespalib::ThreadBundle &threadBundle, uint32_t maxThreads)
+ : _threadBundle(threadBundle),
+ _maxThreads(std::min(maxThreads, static_cast<uint32_t>(threadBundle.size())))
{ }
size_t size() const override { return _maxThreads; }
void run(vespalib::Runnable* const* targets, size_t cnt) override {
@@ -86,9 +86,13 @@ private:
};
bool
-willNeedRanking(const SearchRequest & request, const GroupingContext & groupingContext) {
+willNeedRanking(const SearchRequest & request, const GroupingContext & groupingContext,
+ search::feature_t rank_score_drop_limit)
+{
return (groupingContext.needRanking() || (request.maxhits != 0))
- && (request.sortSpec.empty() || (request.sortSpec.find("[rank]") != vespalib::string::npos));
+ && (request.sortSpec.empty() ||
+ (request.sortSpec.find("[rank]") != vespalib::string::npos) ||
+ !std::isnan(rank_score_drop_limit));
}
SearchReply::UP
@@ -278,7 +282,7 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl
MatchParams params(searchContext.getDocIdLimit(), heapSize, arraySize, rank_score_drop_limit,
request.offset, request.maxhits, !_rankSetup->getSecondPhaseRank().empty(),
- willNeedRanking(request, groupingContext));
+ willNeedRanking(request, groupingContext, rank_score_drop_limit));
ResultProcessor rp(attrContext, metaStore, sessionMgr, groupingContext, sessionId,
request.sortSpec, params.offset, params.hits);