summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-15 08:58:30 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-15 15:39:24 +0000
commitb00db2e084373c0efcf84612787abe40815af11d (patch)
treee81bbc588dcddc2ed6c254f6d9b3bc02f8969abf /searchlib
parentbd3f944be9191e364d97a7f4438c712bce837582 (diff)
add comments; remove unused code
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/common/geo_location_parser.cpp36
-rw-r--r--searchlib/src/vespa/searchlib/common/geo_location_parser.h32
-rw-r--r--searchlib/src/vespa/searchlib/common/geo_location_spec.h3
3 files changed, 9 insertions, 62 deletions
diff --git a/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp b/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp
index 8abf65bd3ee..a44b4f4c5e2 100644
--- a/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp
+++ b/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp
@@ -42,42 +42,6 @@ GeoLocationParser::GeoLocationParser()
_parseError(NULL)
{}
-std::string
-GeoLocationParser::getOldFormatLocationString() const
-{
- vespalib::asciistream loc;
- if (hasPoint()) {
- loc << "(2" // dimensionality
- << "," << _x
- << "," << _y
- << "," << _radius
- << "," << "0" // table id.
- << "," << "1" // rank multiplier.
- << "," << "0" // rank only on distance.
- << "," << _x_aspect // aspect multiplier
- << ")";
- }
- if (hasBoundingBox()) {
- loc << "[2," << _min_x
- << "," << _min_y
- << "," << _max_x
- << "," << _max_y
- << "]" ;
- }
- return loc.str();
-}
-
-std::string
-GeoLocationParser::getOldFormatLocationStringWithField() const
-{
- if (hasFieldName()) {
- return getFieldName() + ":" + getOldFormatLocationString();
- } else {
- return getOldFormatLocationString();
- }
-}
-
-
bool
GeoLocationParser::getDimensionality(const char * &p) {
if (*p == '2') {
diff --git a/searchlib/src/vespa/searchlib/common/geo_location_parser.h b/searchlib/src/vespa/searchlib/common/geo_location_parser.h
index 84c1a7cab07..a9bd152b090 100644
--- a/searchlib/src/vespa/searchlib/common/geo_location_parser.h
+++ b/searchlib/src/vespa/searchlib/common/geo_location_parser.h
@@ -9,41 +9,21 @@
namespace search::common {
+/**
+ * Parser for a geo-location string representation.
+ **/
class GeoLocationParser
{
public:
GeoLocationParser();
- bool isValid() const { return _valid; }
- bool hasPoint() const { return _has_point; }
- bool hasBoundingBox() const { return _has_bounding_box; }
- bool hasFieldName() const { return ! _field_name.empty(); }
-
- uint32_t getXAspect() const { return _x_aspect; }
- int32_t getX() const { return _x; }
- int32_t getY() const { return _y; }
- uint32_t getRadius() const { return _radius; }
-
- int32_t getMinX() const { return _min_x; }
- int32_t getMinY() const { return _min_y; }
- int32_t getMaxX() const { return _max_x; }
- int32_t getMaxY() const { return _max_y; }
-
- std::string getOldFormatLocationString() const;
- std::string getOldFormatLocationStringWithField() const;
- std::string getFieldName() const { return _field_name; }
-
bool parseOldFormat(const std::string &locStr);
- void setFieldName(const std::string &name) { _field_name = name; }
bool parseOldFormatWithField(const std::string &str);
+
+ std::string getFieldName() const { return _field_name; }
GeoLocation getGeoLocation() const;
-#if 0
- GeoLocationSpec spec() const {
- return GeoLocationSpec{_field_name, getGeoLocation()};
- }
-#endif
- const char * getParseError() const { return _parseError; }
+ const char * getParseError() const { return _parseError; }
private:
bool _valid;
bool _has_point;
diff --git a/searchlib/src/vespa/searchlib/common/geo_location_spec.h b/searchlib/src/vespa/searchlib/common/geo_location_spec.h
index 02972172422..42c2b8e6c8c 100644
--- a/searchlib/src/vespa/searchlib/common/geo_location_spec.h
+++ b/searchlib/src/vespa/searchlib/common/geo_location_spec.h
@@ -8,6 +8,9 @@
namespace search::common {
+/**
+ * Immutable specification of a geo-location query item.
+ **/
struct GeoLocationSpec
{
public: