summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-10-16 15:40:50 +0000
committerTor Brede Vekterli <vekterli@yahoo-inc.com>2017-11-14 13:39:49 +0000
commit5519e892e22c7f6fd8da068ff7ab876ee3161faf (patch)
tree88e5b2be5d8f265317b2a03b6b39e2395ce628bc /searchcore
parent69fcc4a227ffb93c5a825077421d462b1427ba24 (diff)
Use new C++ document selection parser
Based on Flex/Bison and replaces old Spirit.Classic parser. New parser is pure and does not require any locking, unlike the previous implementation. This also removes parsing of the deprecated searchcolumn feature. Adds build-time dependencies on Flex and Bison.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/common/selectpruner_test.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp7
2 files changed, 3 insertions, 6 deletions
diff --git a/searchcore/src/tests/proton/common/selectpruner_test.cpp b/searchcore/src/tests/proton/common/selectpruner_test.cpp
index cea72a556cc..4ec5bb928f6 100644
--- a/searchcore/src/tests/proton/common/selectpruner_test.cpp
+++ b/searchcore/src/tests/proton/common/selectpruner_test.cpp
@@ -618,8 +618,6 @@ TEST_F("Test that multiplication has higher priority than addition",
TEST_F("Test that toplevel functions are visited", TestFixture)
{
- f.testPrune("searchcolumn.15 == 4",
- "searchcolumn.15 == 4");
f.testPrune("id.scheme == \"doc\"",
"id.scheme == \"doc\"");
f.testPrune("test.aa < now() - 7200",
diff --git a/searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp b/searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp
index 0915c11acfa..da45953e7b9 100644
--- a/searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp
+++ b/searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp
@@ -21,7 +21,6 @@ using document::select::Or;
using document::select::ArithmeticValueNode;
using document::select::FunctionValueNode;
using document::select::IdValueNode;
-using document::select::SearchColumnValueNode;
using document::select::FieldValueNode;
using document::select::FloatValueNode;
using document::select::VariableValueNode;
@@ -235,7 +234,7 @@ SelectPruner::visitDocumentType(const DocType &expr)
_inverted = true;
res = !res;
}
- _node.reset(new Constant(res ? "true" : "false"));
+ _node.reset(new Constant(res));
_resultSet.add(res ? Result::True : Result::False);
_priority = DocumentTypePriority;
}
@@ -411,7 +410,7 @@ SelectPruner::visitFieldValueNode(const FieldValueNode &expr)
if (!_hasFields) {
// If we're working on removed document sub db then we have no fields.
_constVal = true;
- _valueNode.reset(new NullValueNode("null"));
+ _valueNode.reset(new NullValueNode());
_priority = NullValPriority;
return;
}
@@ -511,7 +510,7 @@ SelectPruner::setTernaryConst(bool val)
{
_constVal = true;
_priority = ConstPriority;
- _node.reset(new Constant(val ? "true" : "false"));
+ _node.reset(new Constant(val));
}
void