diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-03-25 16:43:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-25 16:43:06 +0100 |
commit | 7c4eb18409f536b08a2365db11add6ea1fabcf3d (patch) | |
tree | 5c39615436eeba60990c7201fb000fec1e3ffd4b /searchcore/src | |
parent | 637a6f880a2ca09ef549b157750a04d679c66b78 (diff) |
Revert "- Avoid inlining exchange_location_nodes to be able to see its execut…"
Diffstat (limited to 'searchcore/src')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/query.cpp | 22 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/querynodes.h | 5 |
2 files changed, 11 insertions, 16 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp index 39936126a99..994e26081e7 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp @@ -36,7 +36,6 @@ using search::queryeval::IntermediateBlueprint; using search::queryeval::Blueprint; using search::queryeval::IRequestContext; using search::queryeval::SearchIterator; -using search::query::LocationTerm; using vespalib::string; using std::vector; @@ -60,17 +59,16 @@ inject(Node::UP query, Node::UP to_inject) { return query; } -std::vector<LocationTerm *> +std::vector<ProtonLocationTerm *> find_location_terms(Node *tree) { - std::vector<LocationTerm *> retval; + std::vector<ProtonLocationTerm *> retval; std::vector<Node *> nodes; nodes.push_back(tree); - for (Node * node : nodes) { - if (node->isLocationTerm()) { - retval.push_back(static_cast<LocationTerm *>(node)); + for (size_t i = 0; i < nodes.size(); ++i) { + if (auto loc = dynamic_cast<ProtonLocationTerm *>(nodes[i])) { + retval.push_back(loc); } - if (node->isIntermediate()) { - auto parent = static_cast<const search::query::Intermediate *>(node); + if (auto parent = dynamic_cast<const search::query::Intermediate *>(nodes[i])) { for (Node * child : parent->getChildren()) { nodes.push_back(child); } @@ -94,7 +92,7 @@ GeoLocationSpec parse_location_string(string str) { return empty; } -GeoLocationSpec process_location_term(LocationTerm &pterm) { +GeoLocationSpec process_location_term(ProtonLocationTerm &pterm) { auto old_view = pterm.getView(); auto new_view = PositionDataType::getZCurveFieldName(old_view); pterm.setView(new_view); @@ -103,10 +101,6 @@ GeoLocationSpec process_location_term(LocationTerm &pterm) { } void exchange_location_nodes(const string &location_str, - Node::UP &query_tree, - std::vector<GeoLocationSpec> &fef_locations) __attribute__((noinline)); - -void exchange_location_nodes(const string &location_str, Node::UP &query_tree, std::vector<GeoLocationSpec> &fef_locations) { @@ -116,7 +110,7 @@ void exchange_location_nodes(const string &location_str, if (parsed.location.valid()) { locationSpecs.push_back(parsed); } - for (LocationTerm * pterm : find_location_terms(query_tree.get())) { + for (ProtonLocationTerm * pterm : find_location_terms(query_tree.get())) { auto spec = process_location_term(*pterm); if (spec.location.valid()) { locationSpecs.push_back(spec); diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h index 65a236e4e6e..6cb608c8f8c 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h @@ -98,7 +98,7 @@ struct ProtonTermBase : public Base, }; template <typename Base> -struct ProtonTerm final : public ProtonTermBase<Base> { +struct ProtonTerm : public ProtonTermBase<Base> { using ProtonTermBase<Base>::ProtonTermBase; ~ProtonTerm(); }; @@ -116,7 +116,8 @@ typedef search::query::SimpleWeakAnd ProtonWeakAnd; typedef search::query::SimpleSameElement ProtonSameElement; -struct ProtonEquiv final : public ProtonTermBase<search::query::Equiv> { +struct ProtonEquiv final : public ProtonTermBase<search::query::Equiv> +{ search::fef::MatchDataLayout children_mdl; using ProtonTermBase::ProtonTermBase; }; |