summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/select
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-08 12:55:09 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-15 15:39:20 +0000
commitc50ae024b2ff3f4b1890373ed30fa5a8c90db177 (patch)
tree958fc77db774fc4d3188535297e8db98d1733737 /container-search/src/test/java/com/yahoo/select
parentaacf9c9ccbcd558e58086ee657c5061e038a62f0 (diff)
test geoLocation parsing and generation
Diffstat (limited to 'container-search/src/test/java/com/yahoo/select')
-rw-r--r--container-search/src/test/java/com/yahoo/select/SelectTestCase.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/select/SelectTestCase.java b/container-search/src/test/java/com/yahoo/select/SelectTestCase.java
index 4691ef42e55..af1c1e48011 100644
--- a/container-search/src/test/java/com/yahoo/select/SelectTestCase.java
+++ b/container-search/src/test/java/com/yahoo/select/SelectTestCase.java
@@ -522,6 +522,18 @@ public class SelectTestCase {
}
@Test
+ public void testGeoLocation() {
+ assertParse("{ \"geoLocation\": [ \"workplace\", 63.418417, 10.433033, 500000 ] }",
+ "GEO_LOCATION workplace:(2,10433033,63418417,500000,0,1,0,1921876103)");
+ assertParse("{ \"geoLocation\": [ \"headquarters\", \"37.416383\", \"-122.024683\", \"100 miles\" ] }",
+ "GEO_LOCATION headquarters:(2,-122024683,37416383,1450561,0,1,0,3411238761)");
+ assertParse("{ \"geoLocation\": [ \"home\", \"E10.433033\", \"N63.418417\", \"5km\" ] }",
+ "GEO_LOCATION home:(2,10433033,63418417,45066,0,1,0,1921876103)");
+ assertParse("{ \"geoLocation\": [ \"workplace\", -12.0, -34.0, -77 ] }",
+ "GEO_LOCATION workplace:(2,-34000000,-12000000,-1,0,1,0,4201111954)");
+ }
+
+ @Test
public void testNearestNeighbor() {
assertParse("{ \"nearestNeighbor\": [ \"f1field\", \"q2prop\" ] }",
"NEAREST_NEIGHBOR {field=f1field,queryTensorName=q2prop,hnsw.exploreAdditionalHits=0,approximate=true,targetHits=0}");