summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-08 06:20:30 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-15 15:39:19 +0000
commit4341aa4b4bef1d2136c0b5898ad01a95ea14f4b0 (patch)
tree09c34734196333758e1ae8fb6f8bb98b6c6a2204 /searchcore
parent911f614fbab51de142cbea19f2c1aed9160c132d (diff)
handle possible zcurve suffix
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt1
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.cpp25
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h2
3 files changed, 28 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt
index 558914805d1..ffbab597118 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt
+++ b/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt
@@ -27,6 +27,7 @@ vespa_add_library(searchcore_matching STATIC
querynodes.cpp
ranking_constants.cpp
requestcontext.cpp
+ resolveviewvisitor.cpp
result_processor.cpp
same_element_builder.cpp
sameelementmodifier.cpp
diff --git a/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.cpp b/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.cpp
new file mode 100644
index 00000000000..5e0f1285675
--- /dev/null
+++ b/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.cpp
@@ -0,0 +1,25 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+
+#include "resolveviewvisitor.h"
+#include <vespa/document/datatype/positiondatatype.h>
+#include <vespa/log/log.h>
+
+LOG_SETUP(".proton.matching.resolveviewvisitor");
+
+namespace proton::matching {
+
+void
+ResolveViewVisitor::visit(ProtonLocationTerm &n) {
+ n.resolve(_resolver, _indexEnv);
+ if (n.numFields() == 0) {
+ auto oldView = n.getView();
+ auto newView = document::PositionDataType::getZCurveFieldName(oldView);
+ n.setView(newView);
+ n.resolve(_resolver, _indexEnv);
+ LOG(info, "ProtonLocationTerm found %zu field after view change %s -> %s",
+ n.numFields(), oldView.c_str(), newView.c_str());
+ }
+}
+
+} // namespace
diff --git a/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h b/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h
index 4a12e6adda9..f8c1a007c28 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h
@@ -22,6 +22,8 @@ public:
template <class TermNode>
void visitTerm(TermNode &n) { n.resolve(_resolver, _indexEnv); }
+ void visit(ProtonLocationTerm &n) override;
+
void visit(ProtonNodeTypes::Equiv &n) override {
visitChildren(n);
n.resolveFromChildren(n.getChildren());