From 5fc7cc737144fc27ed7de2761a2f041750c949c7 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Fri, 10 Jul 2020 13:46:01 +0000 Subject: refactor more, add optional field name parsing --- streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp | 6 +++--- streamingvisitors/src/vespa/searchvisitor/queryenvironment.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'streamingvisitors/src') 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 +#include #include 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 getAllLocations() const override { std::vector retval; - retval.push_back(&_location); + if (_location.isValid()) { + retval.push_back(&_location); + } return retval; } -- cgit v1.2.3