aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahooinc.com>2022-06-08 08:31:50 +0000
committerArne H Juul <arnej@yahooinc.com>2022-06-09 08:34:18 +0000
commit29b0a8fdf226fb19b5f3da7d72923671c20d7e66 (patch)
tree71e89b55d7f141860b332bf031a6cff5dbed7818 /searchlib/src
parentca1bdb5394bbd1c2c404888b89da44fff6683a68 (diff)
disallow bad position field
Diffstat (limited to 'searchlib/src')
-rw-r--r--searchlib/src/tests/features/prod_features.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/features/distancefeature.cpp7
2 files changed, 2 insertions, 9 deletions
diff --git a/searchlib/src/tests/features/prod_features.cpp b/searchlib/src/tests/features/prod_features.cpp
index b213fd380d5..ecb1d7be137 100644
--- a/searchlib/src/tests/features/prod_features.cpp
+++ b/searchlib/src/tests/features/prod_features.cpp
@@ -483,8 +483,6 @@ Test::testCloseness()
TEST_DO(assertCloseness(1, "pos", 0));
assertCloseness(0.8, "pos", 1802661);
assertCloseness(0, "pos", 9013306);
- // use non-existing attribute -> default distance
- TEST_DO(assertCloseness(0, "no", 0));
// two-argument version
TEST_DO(assertCloseness(0.8, "field,pos", 1802661));
@@ -893,8 +891,10 @@ Test::testDistance()
StringList params, in, out;
FT_SETUP_FAIL(pt, params);
+ /*
FT_SETUP_OK(pt, params.add("pos"), in,
out.add("out").add("index").add("latitude").add("longitude").add("km"));
+ */
FT_DUMP_EMPTY(_factory, "distance");
}
diff --git a/searchlib/src/vespa/searchlib/features/distancefeature.cpp b/searchlib/src/vespa/searchlib/features/distancefeature.cpp
index 7429f32cf4f..d0a2c1a3838 100644
--- a/searchlib/src/vespa/searchlib/features/distancefeature.cpp
+++ b/searchlib/src/vespa/searchlib/features/distancefeature.cpp
@@ -206,7 +206,6 @@ DistanceBlueprint::setup(const IIndexEnvironment & env,
{
// params[0] = attribute name
vespalib::string arg = params[0].getValue();
- bool allow_bad_field = true;
if (params.size() == 2) {
// params[0] = field / label
// params[1] = attribute name / label value
@@ -217,7 +216,6 @@ DistanceBlueprint::setup(const IIndexEnvironment & env,
return true;
} else if (arg == "field") {
arg = params[1].getValue();
- allow_bad_field = false;
} else {
LOG(error, "first argument must be 'field' or 'label', but was '%s'", arg.c_str());
return false;
@@ -243,11 +241,6 @@ DistanceBlueprint::setup(const IIndexEnvironment & env,
return setup_geopos(env, arg);
}
}
- if (allow_bad_field) {
- // TODO remove on Vespa 8
- // backwards compatibility fallback:
- return setup_geopos(env, arg);
- }
if (env.getFieldByName(arg) == nullptr) {
LOG(error, "unknown field '%s' for rank feature %s\n", arg.c_str(), getName().c_str());
} else {