aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-14 08:45:12 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-15 15:39:23 +0000
commite4f9b819485bcdbd4a0f103268a65004b58650e0 (patch)
treeddf6fa28af313623398e7535a118533751f9d980 /searchsummary
parent2de929825f7c0f5e181ef226c2c9d63b127a403f (diff)
fix TODOs
Diffstat (limited to 'searchsummary')
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp20
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/positionsdfw.cpp2
2 files changed, 13 insertions, 9 deletions
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp
index c42d4d9924d..42afadb386a 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp
@@ -2,6 +2,7 @@
#include "docsumstate.h"
#include <vespa/juniper/rpinterface.h>
+#include <vespa/document/datatype/positiondatatype.h>
#include <vespa/searchcommon/attribute/iattributecontext.h>
#include <vespa/searchlib/common/geo_location.h>
#include <vespa/searchlib/common/geo_location_parser.h>
@@ -68,13 +69,14 @@ GetDocsumsState::get_matching_elements(const MatchingElementsFields &matching_el
void
GetDocsumsState::parse_locations()
{
+ using document::PositionDataType;
assert(_parsedLocations.empty()); // only allowed to call this once
if (! _args.getLocation().empty()) {
- search::common::GeoLocationParser locationParser;
- if (locationParser.parseOldFormatWithField(_args.getLocation())) {
- // TODO: do we need to add _zcurve prefix?
- auto attr_name = locationParser.getFieldName();
- search::common::GeoLocationSpec spec{attr_name, locationParser.getGeoLocation()};
+ search::common::GeoLocationParser parser;
+ if (parser.parseOldFormatWithField(_args.getLocation())) {
+ auto view = parser.getFieldName();
+ auto attr_name = PositionDataType::getZCurveFieldName(view);
+ search::common::GeoLocationSpec spec{attr_name, parser.getGeoLocation()};
_parsedLocations.push_back(spec);
} else {
LOG(warning, "could not parse location string '%s' from request",
@@ -88,10 +90,10 @@ GetDocsumsState::parse_locations()
if (iterator.getType() == search::ParseItem::ITEM_GEO_LOCATION_TERM) {
vespalib::string view = iterator.getIndexName();
vespalib::string term = iterator.getTerm();
- search::common::GeoLocationParser locationParser;
- if (locationParser.parseOldFormat(term)) {
- // TODO: do we need to add _zcurve prefix?
- search::common::GeoLocationSpec spec{view, locationParser.getGeoLocation()};
+ search::common::GeoLocationParser parser;
+ if (parser.parseOldFormat(term)) {
+ auto attr_name = PositionDataType::getZCurveFieldName(view);
+ search::common::GeoLocationSpec spec{attr_name, parser.getGeoLocation()};
_parsedLocations.push_back(spec);
} else {
LOG(warning, "could not parse location string '%s' from stack dump",
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/positionsdfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/positionsdfw.cpp
index 50e1015aa37..182229b3647 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/positionsdfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/positionsdfw.cpp
@@ -34,6 +34,8 @@ LocationAttrDFW::getAllLocations(GetDocsumsState *state)
}
for (const auto & loc : state->_parsedLocations) {
if (loc.location.valid()) {
+ LOG(debug, "found location(field %s) for DFW(field %s)\n",
+ loc.field_name.c_str(), getAttributeName().c_str());
if (getAttributeName() == loc.field_name) {
retval.matching.push_back(&loc.location);
} else {