Skip to content

Commit f436c26

Browse files
authored
SOLR-18039: More tests for repeated knn parents.preFilter (#4159)
Add byte-path parity tests for repeated knn parents.preFilter Signed-off-by: Arup Chauhan <arupchauhan.connect@gmail.com>
1 parent ae4f479 commit f436c26

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

solr/core/src/test/org/apache/solr/search/join/BlockJoinNestedVectorsQParserTest.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,23 @@ public void parentRetrievalByte_knnChildrenWithParentFilter_shouldReturnKnnParen
294294
"//result/doc[3]/str[@name='id'][.='2']");
295295
}
296296

297+
@Test
298+
public void parentRetrievalByte_knnChildrenWithMultipleParentFilters_shouldReturnKnnParents() {
299+
assertQ(
300+
req(
301+
"q", "{!parent which=$allParents score=max v=$children.q}",
302+
"fl", "id,score",
303+
"children.q",
304+
"{!knn f=vector_byte topK=3 parents.preFilter=$parentFilter1 parents.preFilter=$parentFilter2 childrenOf=$allParents}"
305+
+ BYTE_QUERY_VECTOR,
306+
"allParents", "parent_s:[* TO *]",
307+
"parentFilter1", "parent_s:(a c)",
308+
"parentFilter2", "parent_s:(c e)"),
309+
"//*[@numFound='2']",
310+
"//result/doc[1]/str[@name='id'][.='8']",
311+
"//result/doc[2]/str[@name='id'][.='2']");
312+
}
313+
297314
@Test
298315
public void
299316
parentRetrievalByte_knnChildrenWithParentFilterAndChildrenFilter_shouldReturnKnnParents() {
@@ -311,6 +328,24 @@ public void parentRetrievalByte_knnChildrenWithParentFilter_shouldReturnKnnParen
311328
"//result/doc[2]/str[@name='id'][.='2']");
312329
}
313330

331+
@Test
332+
public void
333+
parentRetrievalByte_knnChildrenWithMultipleParentFiltersAndChildrenFilter_shouldReturnKnnParents() {
334+
assertQ(
335+
req(
336+
"q", "{!parent which=$allParents score=max v=$children.q}",
337+
"fl", "id,score",
338+
"children.q",
339+
"{!knn f=vector_byte topK=3 preFilter=child_s:m parents.preFilter=$parentFilter1 parents.preFilter=$parentFilter2 childrenOf=$allParents}"
340+
+ BYTE_QUERY_VECTOR,
341+
"allParents", "parent_s:[* TO *]",
342+
"parentFilter1", "parent_s:(a c)",
343+
"parentFilter2", "parent_s:(c e)"),
344+
"//*[@numFound='2']",
345+
"//result/doc[1]/str[@name='id'][.='8']",
346+
"//result/doc[2]/str[@name='id'][.='2']");
347+
}
348+
314349
@Test
315350
public void
316351
parentRetrievalFloat_topKWithChildTransformerWithFilter_shouldUseOriginalChildTransformerFilter() {

0 commit comments

Comments
 (0)