diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-14 15:23:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-14 15:23:07 +0200 |
commit | e98b5a77300eda52f082b9c17b9cf4915b3fe4b0 (patch) | |
tree | 130c8d128ab5774a44bdc135452145f33f319ea5 | |
parent | 5fc7f6e157c4e8b04f3095a01e8e85653fc301f4 (diff) | |
parent | 62763aa02a8d19dfff33ecb1474c3f9e99a79882 (diff) |
Merge pull request #14047 from vespa-engine/arnej/use-negative-1-as-inf
Arnej/use negative 1 as inf
5 files changed, 12 insertions, 6 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/Location.java b/container-search/src/main/java/com/yahoo/prelude/Location.java index 3d3eed3b3df..f6228509bbb 100644 --- a/container-search/src/main/java/com/yahoo/prelude/Location.java +++ b/container-search/src/main/java/com/yahoo/prelude/Location.java @@ -374,7 +374,7 @@ public class Location { } private int backendRadius() { - return (r < 0) ? (512 * 1024 * 1024) : r; + return (r < 0) ? -1 : r; } /** diff --git a/container-search/src/main/java/com/yahoo/prelude/fastsearch/VespaBackEndSearcher.java b/container-search/src/main/java/com/yahoo/prelude/fastsearch/VespaBackEndSearcher.java index bc3ac6cdef1..e5e46f21a2a 100644 --- a/container-search/src/main/java/com/yahoo/prelude/fastsearch/VespaBackEndSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/fastsearch/VespaBackEndSearcher.java @@ -257,7 +257,7 @@ public abstract class VespaBackEndSearcher extends PingableSearcher { if (query.getRanking().getLocation() != null) { s.append(" location=") - .append(query.getRanking().getLocation().toString()); + .append(query.getRanking().getLocation().backendString()); } if (query.getGroupingSessionCache()) { diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/ProtobufSerialization.java b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/ProtobufSerialization.java index 51290c245ac..6dc01f34571 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/ProtobufSerialization.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/ProtobufSerialization.java @@ -101,7 +101,7 @@ public class ProtobufSerialization { mergeToSearchRequestFromSorting(ranking.getSorting(), builder); } if (ranking.getLocation() != null) { - builder.setGeoLocation(ranking.getLocation().toString()); + builder.setGeoLocation(ranking.getLocation().backendString()); } var featureMap = ranking.getFeatures().asMap(); @@ -144,7 +144,7 @@ public class ProtobufSerialization { builder.setRankProfile(ranking.getProfile()); if (ranking.getLocation() != null) { - builder.setGeoLocation(ranking.getLocation().toString()); + builder.setGeoLocation(ranking.getLocation().backendString()); } if (includeQueryData) { mergeQueryDataToDocsumRequest(query, builder); diff --git a/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java index aa48e8494f2..b0c593ea405 100644 --- a/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java @@ -121,10 +121,10 @@ public class PosSearcherTestCase { q = new Query(); q.properties().set("pos.ll", "N0;E0"); - q.properties().set("pos.radius", "-1"); + q.properties().set("pos.radius", "-42"); doSearch(searcher, q, 0, 10); assertEquals("(2,0,0,-1,0,1,0,4294967295)", q.getRanking().getLocation().toString()); - assertEquals("(2,0,0,536870912,0,1,0,4294967295)", q.getRanking().getLocation().backendString()); + assertEquals("(2,0,0,-1,0,1,0,4294967295)", q.getRanking().getLocation().backendString()); } /** diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp index cb587d77133..032caaacba8 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp @@ -273,6 +273,11 @@ public: Blueprint::UP make_location_blueprint(const FieldSpec &field, const IAttributeVector &attribute, const Location &loc) { + LOG(debug, "make_location_blueprint(p[%d,%d], r[%u], aspect[%u], bb[[%d,%d],[%d,%d]])", + loc.point.x, loc.point.y, loc.radius, + loc.x_aspect.multiplier, + loc.bounding_box.x.low, loc.bounding_box.x.high, + loc.bounding_box.y.low, loc.bounding_box.y.high); auto post_filter = std::make_unique<LocationPostFilterBlueprint>(field, attribute, loc); const common::Location &location = post_filter->location(); if (location.bounding_box.x.low > location.bounding_box.x.high || @@ -287,6 +292,7 @@ make_location_blueprint(const FieldSpec &field, const IAttributeVector &attribut location.bounding_box.y.high); auto pre_filter = std::make_unique<LocationPreFilterBlueprint>(field, attribute, rangeVector); if (!pre_filter->should_use()) { + LOG(debug, "only use post filter"); return post_filter; } auto root = std::make_unique<AndBlueprint>(); |