summaryrefslogtreecommitdiffstats
path: root/streamingvisitors
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-14 06:42:52 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-15 15:39:23 +0000
commit9534d9ef4d74017ff4ef0849924f751403979cbb (patch)
tree54bfac4a2cb6d39e64eb8ee920ac12307d6a0100 /streamingvisitors
parent909c3b8f302cbe615d38139d202e809c9f6079a4 (diff)
finish rewrite to use GeoLocation
Diffstat (limited to 'streamingvisitors')
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp
index 5112ce59dfb..6096a2faea4 100644
--- a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp
@@ -1,7 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "queryenvironment.h"
+#include <vespa/searchlib/common/geo_location.h>
#include <vespa/searchlib/common/geo_location_spec.h>
+#include <vespa/searchlib/common/geo_location_parser.h>
#include <vespa/log/log.h>
LOG_SETUP(".searchvisitor.queryenvironment");
@@ -27,12 +29,14 @@ parseLocation(const string & location_str)
location_str.c_str(), locationParser.getParseError());
return fefLocation;
}
- auto locationSpec = locationParser.spec();
- fefLocation.setAttribute(locationSpec.getFieldName());
- fefLocation.setXPosition(locationSpec.getX());
- fefLocation.setYPosition(locationSpec.getY());
- fefLocation.setXAspect(locationSpec.getXAspect());
- fefLocation.setValid(true);
+ auto location = locationParser.getGeoLocation();
+ if (location.has_point) {
+ fefLocation.setAttribute(locationParser.getFieldName());
+ fefLocation.setXPosition(location.point.x);
+ fefLocation.setYPosition(location.point.y);
+ fefLocation.setXAspect(location.x_aspect.multiplier);
+ fefLocation.setValid(true);
+ }
return fefLocation;
}