aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/query/querybuilder_test.cpp
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-01-07 12:42:17 +0000
committerArne Juul <arnej@verizonmedia.com>2021-01-08 10:56:14 +0000
commitcf199f338efafad8c0af7de48094bd3d0037b96a (patch)
tree2c63ecee902b297006edb41a67925e721bfddff6 /searchlib/src/tests/query/querybuilder_test.cpp
parent8aa9ffda4324ddd5baff87be858063c6399a26ca (diff)
add distanceThreshold option for nearestNeighbor operator
Diffstat (limited to 'searchlib/src/tests/query/querybuilder_test.cpp')
-rw-r--r--searchlib/src/tests/query/querybuilder_test.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/searchlib/src/tests/query/querybuilder_test.cpp b/searchlib/src/tests/query/querybuilder_test.cpp
index 5a5a5eafb2c..30b4d2ae264 100644
--- a/searchlib/src/tests/query/querybuilder_test.cpp
+++ b/searchlib/src/tests/query/querybuilder_test.cpp
@@ -110,7 +110,7 @@ Node::UP createQueryTree() {
builder.addStringTerm(str[5], view[5], id[5], weight[6]);
builder.addStringTerm(str[6], view[6], id[6], weight[7]);
}
- builder.add_nearest_neighbor_term("query_tensor", "doc_tensor", id[3], weight[5], 7, true, 33);
+ builder.add_nearest_neighbor_term("query_tensor", "doc_tensor", id[3], weight[5], 7, true, 33, 100100.25);
}
Node::UP node = builder.build();
ASSERT_TRUE(node.get());
@@ -395,8 +395,9 @@ struct MyRegExpTerm : RegExpTerm {
struct MyNearestNeighborTerm : NearestNeighborTerm {
MyNearestNeighborTerm(vespalib::stringref query_tensor_name, vespalib::stringref field_name,
int32_t i, Weight w, uint32_t target_num_hits,
- bool allow_approximate, uint32_t explore_additional_hits)
- : NearestNeighborTerm(query_tensor_name, field_name, i, w, target_num_hits, allow_approximate, explore_additional_hits)
+ bool allow_approximate, uint32_t explore_additional_hits,
+ double distance_threshold)
+ : NearestNeighborTerm(query_tensor_name, field_name, i, w, target_num_hits, allow_approximate, explore_additional_hits, distance_threshold)
{}
};