aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/select
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-06-19 10:02:54 +0000
committerArne Juul <arnej@verizonmedia.com>2020-06-19 10:02:54 +0000
commitede285634d82b6e4f4c39158863408d8ffd81377 (patch)
treefc6a5f6ec0497f0ffc8561373c42512e372f1712 /container-search/src/test/java/com/yahoo/select
parentae1297268fa447f7fb7f2f548d4f32c5327ec187 (diff)
extend unit test and fix bug found by it
Diffstat (limited to 'container-search/src/test/java/com/yahoo/select')
-rw-r--r--container-search/src/test/java/com/yahoo/select/SelectTestCase.java9
1 files changed, 9 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 d2896aca870..4691ef42e55 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,15 @@ public class SelectTestCase {
}
@Test
+ public void testNearestNeighbor() {
+ assertParse("{ \"nearestNeighbor\": [ \"f1field\", \"q2prop\" ] }",
+ "NEAREST_NEIGHBOR {field=f1field,queryTensorName=q2prop,hnsw.exploreAdditionalHits=0,approximate=true,targetHits=0}");
+
+ assertParse("{ \"nearestNeighbor\": { \"children\" : [ \"f3field\", \"q4prop\" ], \"attributes\" : {\"targetHits\": 37} }}",
+ "NEAREST_NEIGHBOR {field=f3field,queryTensorName=q4prop,hnsw.exploreAdditionalHits=0,approximate=true,targetHits=37}");
+ }
+
+ @Test
public void testWeakAnd() {
assertParse("{ \"weakAnd\": [{ \"contains\": [\"a\", \"A\"] }, { \"contains\": [\"b\", \"B\"] } ] }",
"WAND(100) a:A b:B");