summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-05-23 17:28:30 +0200
committerGitHub <noreply@github.com>2022-05-23 17:28:30 +0200
commit204be838157b79944f247466c78723775c7f4283 (patch)
tree4a6eab6f290ae9b38245f0d49a1047e76fca2c51
parent69ba67594791c561c0d5c989f890f2f008289a50 (diff)
parente550b6b96a4fe9f8a24ca15fbd39ae45d3dcb06b (diff)
Merge pull request #22715 from vespa-engine/toregge/avoid-bad-brute-force-fallback
Don't use brute force iterator if we have performed search in hnsw in…
-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,