summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-05-23 17:06:38 +0200
committerTor Egge <Tor.Egge@online.no>2022-05-23 17:06:38 +0200
commite550b6b96a4fe9f8a24ca15fbd39ae45d3dcb06b (patch)
tree9dc4d81f3f51a12f14dc2f5bb5b3fc00da68ac35 /searchlib
parente657c0a9618868c9dcf32cfa7e05ac73750b904c (diff)
Don't use brute force iterator if we have performed search in hnsw index.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp
index 179a3fc29dd..cb15b877311 100644
--- a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp
@@ -171,8 +171,12 @@ NearestNeighborBlueprint::createLeafSearch(const search::fef::TermFieldMatchData
{
assert(tfmda.size() == 1);
fef::TermFieldMatchData &tfmd = *tfmda[0]; // always search in only one field
- if (! _found_hits.empty()) {
+ switch (_algorithm) {
+ case Algorithm::INDEX_TOP_K_WITH_FILTER:
+ case Algorithm::INDEX_TOP_K:
return NnsIndexIterator::create(tfmd, _found_hits, _dist_fun);
+ default:
+ ;
}
const Value &qT = *_query_tensor;
return NearestNeighborIterator::create(strict, tfmd, qT, _attr_tensor,