aboutsummaryrefslogtreecommitdiffstats
path: root/streamingvisitors
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-10 13:46:01 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-15 15:39:22 +0000
commit5fc7cc737144fc27ed7de2761a2f041750c949c7 (patch)
treef79a07acd21cd2c6d6d3e85a10ab836b0454dab4 /streamingvisitors
parent42a328d165fb48f800b9cba556b8d24d4759d609 (diff)
refactor more, add optional field name parsing
Diffstat (limited to 'streamingvisitors')
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp6
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/queryenvironment.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp
index 37809b207ad..70d304b4a87 100644
--- a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp
@@ -1,7 +1,7 @@
// 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/location.h>
+#include <vespa/searchlib/common/geo_location_spec.h>
#include <vespa/log/log.h>
LOG_SETUP(".searchvisitor.queryenvironment");
@@ -30,8 +30,8 @@ parseLocation(const string & location_str)
string attr = location_str.substr(0, pos);
const string location = location_str.substr(pos + 1);
- search::common::Location locationSpec;
- if (!locationSpec.parse(location)) {
+ search::common::GeoLocationSpec locationSpec;
+ if (!locationSpec.parseOldFormat(location)) {
LOG(warning, "Location parse error (location: '%s'): %s. Location ignored.",
location.c_str(), locationSpec.getParseError());
return fefLocation;
diff --git a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.h b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.h
index b77562b8bbc..afbd0e27caf 100644
--- a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.h
+++ b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.h
@@ -53,7 +53,9 @@ public:
std::vector<const search::fef::Location *> getAllLocations() const override {
std::vector<const search::fef::Location *> retval;
- retval.push_back(&_location);
+ if (_location.isValid()) {
+ retval.push_back(&_location);
+ }
return retval;
}