aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2019-11-19 12:37:16 +0000
committerGeir Storli <geirst@verizonmedia.com>2019-11-19 12:38:27 +0000
commit5361472f495df07e9b1ae2af91c2f780ed8966df (patch)
tree78f044702c6dbf490c73fcc675ed0625478148a5 /searchcore
parente8c2faeb2c1feac0a3712592f4a55ce276d2fc60 (diff)
Add skeleton for NearestNeighborTerm in C++.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/matching/query_test.cpp2
-rw-r--r--searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/querynodes.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp1
7 files changed, 15 insertions, 0 deletions
diff --git a/searchcore/src/tests/proton/matching/query_test.cpp b/searchcore/src/tests/proton/matching/query_test.cpp
index 03f20876adc..a80b08badf8 100644
--- a/searchcore/src/tests/proton/matching/query_test.cpp
+++ b/searchcore/src/tests/proton/matching/query_test.cpp
@@ -272,6 +272,7 @@ public:
void visit(ProtonWandTerm &) override {}
void visit(ProtonPredicateQuery &) override {}
void visit(ProtonRegExpTerm &) override {}
+ void visit(ProtonNearestNeighborTerm &) override {}
};
void Test::requireThatTermsAreLookedUp() {
@@ -423,6 +424,7 @@ public:
void visit(ProtonWandTerm &) override {}
void visit(ProtonPredicateQuery &) override {}
void visit(ProtonRegExpTerm &) override {}
+ void visit(ProtonNearestNeighborTerm &) override {}
};
void Test::requireThatTermDataIsFilledIn() {
diff --git a/searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp b/searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp
index c0418d82359..9ecbd532389 100644
--- a/searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp
+++ b/searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp
@@ -65,6 +65,7 @@ struct DumpQuery : QueryVisitor {
void visit(WandTerm &) override {}
void visit(PredicateQuery &) override {}
void visit(RegExpTerm &) override {}
+ void visit(NearestNeighborTerm &) override {}
};
std::string dump_query(Node &root) {
diff --git a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp
index 7e55c8f778c..2ec3d5b18ee 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp
@@ -109,6 +109,12 @@ private:
_result = builder.build();
}
+ void buildNearestNeighborTerm(ProtonNearestNeighborTerm &n) {
+ (void) n;
+ // TODO (geirst): implement
+ _result = std::make_unique<EmptyBlueprint>();
+ }
+
template <typename NodeType>
void buildTerm(NodeType &n) {
FieldSpecList indexFields;
@@ -143,6 +149,7 @@ protected:
void visit(ProtonNear &n) override { buildIntermediate(new NearBlueprint(n.getDistance()), n); }
void visit(ProtonONear &n) override { buildIntermediate(new ONearBlueprint(n.getDistance()), n); }
void visit(ProtonSameElement &n) override { buildSameElement(n); }
+ void visit(ProtonNearestNeighborTerm &n) override { buildNearestNeighborTerm(n); }
void visit(ProtonWeightedSetTerm &n) override { buildTerm(n); }
diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h
index 6454845b247..d7ec24edb8f 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h
@@ -137,6 +137,7 @@ typedef ProtonTerm<search::query::DotProduct> ProtonDotProduct;
typedef ProtonTerm<search::query::WandTerm> ProtonWandTerm;
typedef ProtonTerm<search::query::PredicateQuery> ProtonPredicateQuery;
typedef ProtonTerm<search::query::RegExpTerm> ProtonRegExpTerm;
+typedef ProtonTerm<search::query::NearestNeighborTerm> ProtonNearestNeighborTerm;
struct ProtonNodeTypes {
typedef ProtonAnd And;
@@ -161,6 +162,7 @@ struct ProtonNodeTypes {
typedef ProtonWandTerm WandTerm;
typedef ProtonPredicateQuery PredicateQuery;
typedef ProtonRegExpTerm RegExpTerm;
+ typedef ProtonNearestNeighborTerm NearestNeighborTerm;
};
}
diff --git a/searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp b/searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp
index 241ab53874f..1e5df97a659 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp
@@ -67,6 +67,7 @@ public:
void visit(ProtonSuffixTerm &n) override { visitTerm(n); }
void visit(ProtonPredicateQuery &) override {}
void visit(ProtonRegExpTerm &n) override { visitTerm(n); }
+ void visit(ProtonNearestNeighborTerm &) override {}
};
} // namespace proton::matching::<unnamed>
diff --git a/searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp b/searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp
index 3fd4000bf9f..2a87c4dc953 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp
@@ -42,6 +42,7 @@ struct TermDataFromTermVisitor
void visit(ProtonSuffixTerm &n) override { visitTerm(n); }
void visit(ProtonPredicateQuery &) override { }
void visit(ProtonRegExpTerm &n) override { visitTerm(n); }
+ void visit(ProtonNearestNeighborTerm &) override { }
};
} // namespace
diff --git a/searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp b/searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp
index af355452c73..eada88010dd 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp
@@ -56,6 +56,7 @@ struct TermExpander : QueryVisitor {
void visit(WandTerm &) override {}
void visit(PredicateQuery &) override {}
void visit(RegExpTerm &) override {}
+ void visit(NearestNeighborTerm &) override {}
void flush(Intermediate &parent) {
for (Node::UP &term: terms) {
parent.append(std::move(term));