summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchlib/src/tests/fef/properties/properties_test.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/fef/indexproperties.cpp13
-rw-r--r--searchlib/src/vespa/searchlib/fef/indexproperties.h11
3 files changed, 32 insertions, 0 deletions
diff --git a/searchlib/src/tests/fef/properties/properties_test.cpp b/searchlib/src/tests/fef/properties/properties_test.cpp
index 7ca79599d5c..7f5594ea821 100644
--- a/searchlib/src/tests/fef/properties/properties_test.cpp
+++ b/searchlib/src/tests/fef/properties/properties_test.cpp
@@ -215,6 +215,14 @@ TEST("test stuff") {
}
{ // test index properties known by the framework
+ { // vespa.eval.lazy_expressions
+ EXPECT_EQUAL(eval::LazyExpressions::NAME, vespalib::string("vespa.eval.lazy_expressions"));
+ EXPECT_EQUAL(eval::LazyExpressions::DEFAULT_VALUE, vespalib::string("false"));
+ Properties p;
+ EXPECT_TRUE(!eval::LazyExpressions::check(p));
+ p.add("vespa.eval.lazy_expressions", "true");
+ EXPECT_TRUE(eval::LazyExpressions::check(p));
+ }
{ // vespa.rank.firstphase
EXPECT_EQUAL(rank::FirstPhase::NAME, vespalib::string("vespa.rank.firstphase"));
EXPECT_EQUAL(rank::FirstPhase::DEFAULT_VALUE, vespalib::string("nativeRank"));
diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
index 23874924ddb..b75a0f33393 100644
--- a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
+++ b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
@@ -74,6 +74,19 @@ checkIfTrue(const Properties &props, const vespalib::string &name,
}
+namespace eval {
+
+const vespalib::string LazyExpressions::NAME("vespa.eval.lazy_expressions");
+const vespalib::string LazyExpressions::DEFAULT_VALUE("false");
+
+bool
+LazyExpressions::check(const Properties &props)
+{
+ return checkIfTrue(props, NAME, DEFAULT_VALUE);
+}
+
+} // namespace eval
+
namespace rank {
const vespalib::string FirstPhase::NAME("vespa.rank.firstphase");
diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.h b/searchlib/src/vespa/searchlib/fef/indexproperties.h
index 2a37f2f93fd..4a97535879b 100644
--- a/searchlib/src/vespa/searchlib/fef/indexproperties.h
+++ b/searchlib/src/vespa/searchlib/fef/indexproperties.h
@@ -21,6 +21,17 @@ class Properties;
**/
namespace indexproperties {
+namespace eval {
+
+// lazy evaluation of expressions. affects rank/summary/dump
+struct LazyExpressions {
+ static const vespalib::string NAME;
+ static const vespalib::string DEFAULT_VALUE;
+ static bool check(const Properties &props);
+};
+
+} // namespace eval
+
namespace rank {
/**