summaryrefslogtreecommitdiffstats
path: root/searchlib/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-09-02 18:49:06 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-09-02 18:49:06 +0000
commit4118ba0bfd445b05f9e4dacde02213d374deff1f (patch)
treeacad78c60790f4cb68eb623368d4520aa08d8827 /searchlib/src
parent3072a5dcb6d68db03e31503ebcbf01d7dcce1d95 (diff)
Rank-property 'vespa.mutate.allow_query_override: true' must be set in rank-profile to allow for query side control.
Diffstat (limited to 'searchlib/src')
-rw-r--r--searchlib/src/vespa/searchlib/fef/indexproperties.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/fef/indexproperties.h8
-rw-r--r--searchlib/src/vespa/searchlib/fef/ranksetup.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/fef/ranksetup.h3
4 files changed, 19 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
index 6ede2eca73c..ce0d73807a0 100644
--- a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
+++ b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
@@ -173,6 +173,11 @@ namespace onsummary {
namespace mutate {
+const vespalib::string AllowQueryOverride::NAME("vespa.mutate.allow_query_override");
+bool AllowQueryOverride::check(const Properties &props) {
+ return lookupBool(props, NAME, false);
+}
+
namespace on_match {
const vespalib::string Attribute::NAME("vespa.mutate.on_match.attribute");
diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.h b/searchlib/src/vespa/searchlib/fef/indexproperties.h
index fb6c0e5560b..a2b83fc2193 100644
--- a/searchlib/src/vespa/searchlib/fef/indexproperties.h
+++ b/searchlib/src/vespa/searchlib/fef/indexproperties.h
@@ -167,6 +167,14 @@ namespace execute::onsummary {
};
}
+namespace mutate {
+ //TODO Remove October 2022
+ struct AllowQueryOverride {
+ static const vespalib::string NAME;
+ static bool check(const Properties &props);
+ };
+}
+
namespace mutate::on_match {
struct Attribute {
static const vespalib::string NAME;
diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.cpp b/searchlib/src/vespa/searchlib/fef/ranksetup.cpp
index f725756c269..a314ce9c5e1 100644
--- a/searchlib/src/vespa/searchlib/fef/ranksetup.cpp
+++ b/searchlib/src/vespa/searchlib/fef/ranksetup.cpp
@@ -71,7 +71,8 @@ RankSetup::RankSetup(const BlueprintFactory &factory, const IIndexEnvironment &i
_mutateOnMatch(),
_mutateOnFirstPhase(),
_mutateOnSecondPhase(),
- _mutateOnSummary()
+ _mutateOnSummary(),
+ _mutateAllowQueryOverride(false)
{ }
RankSetup::~RankSetup() = default;
@@ -129,6 +130,7 @@ RankSetup::configure()
_mutateOnSecondPhase._operation = mutate::on_second_phase::Operation::lookup(_indexEnv.getProperties());
_mutateOnSummary._attribute = mutate::on_summary::Attribute::lookup(_indexEnv.getProperties());
_mutateOnSummary._operation = mutate::on_summary::Operation::lookup(_indexEnv.getProperties());
+ _mutateAllowQueryOverride = mutate::AllowQueryOverride::check(_indexEnv.getProperties());
}
void
diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.h b/searchlib/src/vespa/searchlib/fef/ranksetup.h
index 866bf2286db..7e08e3c7d17 100644
--- a/searchlib/src/vespa/searchlib/fef/ranksetup.h
+++ b/searchlib/src/vespa/searchlib/fef/ranksetup.h
@@ -82,6 +82,7 @@ private:
MutateOperation _mutateOnFirstPhase;
MutateOperation _mutateOnSecondPhase;
MutateOperation _mutateOnSummary;
+ bool _mutateAllowQueryOverride;
void compileAndCheckForErrors(BlueprintResolver &bp);
public:
@@ -467,6 +468,8 @@ public:
const MutateOperation & getMutateOnFirstPhase() const { return _mutateOnFirstPhase; }
const MutateOperation & getMutateOnSecondPhase() const { return _mutateOnSecondPhase; }
const MutateOperation & getMutateOnSummary() const { return _mutateOnSummary; }
+
+ bool allowMutateQueryOverride() const { return _mutateAllowQueryOverride; }
};
}