diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-07-16 12:12:31 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-07-16 12:23:08 +0000 |
commit | 1a7c5ee8f054b8838c4d15661b42600a12895bd1 (patch) | |
tree | 20d074532ed49aa3bc50e54902656b2d22909d3c /searchcore | |
parent | 8252b6237053b344c07f082eed9422371ae0d0f2 (diff) |
remove fef::Location, use common::GeoLocationSpec instead
Diffstat (limited to 'searchcore')
4 files changed, 11 insertions, 15 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp index 8edf85657dc..65959e6e6de 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp @@ -102,7 +102,7 @@ GeoLocationSpec process_location_term(ProtonLocationTerm &pterm) { void exchange_location_nodes(const string &location_str, Node::UP &query_tree, - std::vector<search::fef::Location> &fef_locations) + std::vector<GeoLocationSpec> &fef_locations) { std::vector<GeoLocationSpec> locationSpecs; @@ -118,13 +118,7 @@ void exchange_location_nodes(const string &location_str, } for (const GeoLocationSpec &spec : locationSpecs) { if (spec.location.has_point) { - search::fef::Location fef_loc; - fef_loc.setAttribute(spec.field_name); - fef_loc.setXPosition(spec.location.point.x); - fef_loc.setYPosition(spec.location.point.y); - fef_loc.setXAspect(spec.location.x_aspect.multiplier); - fef_loc.setValid(true); - fef_locations.push_back(fef_loc); + fef_locations.push_back(spec); } } if (parsed.location.can_limit()) { @@ -189,7 +183,7 @@ Query::extractTerms(vector<const ITermData *> &terms) } void -Query::extractLocations(vector<const search::fef::Location *> &locations) +Query::extractLocations(vector<const GeoLocationSpec *> &locations) { locations.clear(); for (const auto & loc : _locations) { diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.h b/searchcore/src/vespa/searchcore/proton/matching/query.h index 5a484d2ce1f..adedfd1e626 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.h +++ b/searchcore/src/vespa/searchcore/proton/matching/query.h @@ -22,9 +22,12 @@ private: search::query::Node::UP _query_tree; Blueprint::UP _blueprint; Blueprint::UP _whiteListBlueprint; - std::vector<search::fef::Location> _locations; + std::vector<search::common::GeoLocationSpec> _locations; public: + /** Convenience typedef. */ + using GeoLocationSpecPtrs = std::vector<const search::common::GeoLocationSpec *>; + Query(); ~Query(); /** @@ -65,7 +68,7 @@ public: * * @param locs where to collect locations **/ - void extractLocations(std::vector<const search::fef::Location *> &locs); + void extractLocations(GeoLocationSpecPtrs &locs); /** * Reserve room for terms in the query in the given match data diff --git a/searchcore/src/vespa/searchcore/proton/matching/queryenvironment.cpp b/searchcore/src/vespa/searchcore/proton/matching/queryenvironment.cpp index 667b48d2acd..448ce14dd51 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/queryenvironment.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/queryenvironment.cpp @@ -5,7 +5,6 @@ using search::attribute::IAttributeContext; using search::fef::IIndexEnvironment; -using search::fef::Location; using search::fef::Properties; namespace proton::matching { diff --git a/searchcore/src/vespa/searchcore/proton/matching/queryenvironment.h b/searchcore/src/vespa/searchcore/proton/matching/queryenvironment.h index 426123599bd..57b758fd19e 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/queryenvironment.h +++ b/searchcore/src/vespa/searchcore/proton/matching/queryenvironment.h @@ -19,7 +19,7 @@ private: const search::fef::IIndexEnvironment &_indexEnv; const search::attribute::IAttributeContext &_attrContext; search::fef::Properties _properties; - std::vector<const search::fef::Location *> _locations; + GeoLocationSpecPtrs _locations; std::vector<const search::fef::ITermData *> _terms; const search::index::IFieldLengthInspector &_field_length_inspector; @@ -56,7 +56,7 @@ public: * * @return modifiable list of location data pointers **/ - std::vector<const search::fef::Location *> &locations() { + GeoLocationSpecPtrs &locations() { return _locations; } @@ -70,7 +70,7 @@ public: const search::fef::ITermData *getTerm(uint32_t idx) const override; // inherited from search::fef::IQueryEnvironment - std::vector<const search::fef::Location *> getAllLocations() const override { + GeoLocationSpecPtrs getAllLocations() const override { return _locations; } |