Skip to content

Commit d53c2d3

Browse files
authored
Merge pull request #36395 from vespa-engine/johsol/select-language-parity-wand-weakand
Add parity tests for wand and weakAnd with annotations
2 parents 8f8d1a3 + 21d50f0 commit d53c2d3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

container-search/src/test/java/com/yahoo/search/query/YqlJsonQueryFeatureParityTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,24 @@ void testWeakAnd() {
179179
"{ 'weakAnd' : [ { 'contains' : ['a', 'A'] }, { 'contains' : ['b', 'B'] } ] }");
180180
}
181181

182+
@Test
183+
void testWeakAndWithAnnotations() {
184+
assertWhereParity("{scoreThreshold: 41, totalTargetHits: 7}weakAnd(a contains 'A', b contains 'B')",
185+
"{ 'weakAnd' : { 'children' : [ { 'contains' : ['a', 'A'] }, { 'contains' : ['b', 'B'] } ], 'attributes' : { 'scoreThreshold': 41, 'totalTargetHits': 7 } } }");
186+
}
187+
182188
@Test
183189
void testWand() {
184190
assertWhereParity("wand(description, {'a': 1, 'b': 2})",
185191
"{ 'wand' : ['description', { 'a': 1, 'b': 2 }] }");
186192
}
187193

194+
@Test
195+
void testWandWithAnnotations() {
196+
assertWhereParity("[{'scoreThreshold': 13, 'totalTargetHits': 7}]wand(description, {'a': 1, 'b': 2})",
197+
"{ 'wand' : { 'children' : ['description', { 'a': 1, 'b': 2 }], 'attributes' : { 'scoreThreshold': 13, 'totalTargetHits': 7 } } }");
198+
}
199+
188200
@Test
189201
void testWeightedSet() {
190202
assertWhereParity("weightedSet(description, {'a': 1, 'b': 2})",

0 commit comments

Comments
 (0)