diff options
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp index bdd360aa9da..5e46d24a98d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp @@ -101,11 +101,12 @@ NearestNeighborBlueprint::set_global_filter(const GlobalFilter &global_filter) _approximate = false; return; } + est_hits = std::min(est_hits, max_hits); } - perform_top_k(); - est_hits = _found_hits.size(); - LOG(debug, "perform_top_k found %u hits", est_hits); + est_hits = std::min(est_hits, _target_num_hits); setEstimate(HitEstimate(est_hits, false)); + perform_top_k(); + LOG(debug, "perform_top_k found %zu hits", _found_hits.size()); } } |