summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2017-12-07 10:41:55 +0100
committerGitHub <noreply@github.com>2017-12-07 10:41:55 +0100
commitff0e8671bb8e4d58ae424cdce791bbe61eb3eb8b (patch)
tree1affbc75f30adf87675b0cdf51f16fc9b09bf610 /searchcore
parent1c346b4541f5f954e7fb594a30c2e0c10e5c157a (diff)
parent5519e892e22c7f6fd8da068ff7ab876ee3161faf (diff)
Merge pull request #4126 from vespa-engine/vekterli/move-to-flex-bison-parsing-for-document-selection-rebased
Use new C++ document selection parser
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