You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2026/07/20 18:28:38 UTC
(solr) 06/06: SOLR-18039: More tests for repeated knn parents.preFilter (#4159)
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/solr.git
commit 9f61d40b67838f00d9a3c0f46d85e57c4a39e4a9
Author: Arup Chauhan <ar...@gmail.com>
AuthorDate: Sat Apr 25 23:39:16 2026 -0500
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 <ar...@gmail.com>
(cherry picked from commit f436c26fb66b1a98c738cf7cde3582678126ae59)
---
.../join/BlockJoinNestedVectorsQParserTest.java | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/solr/core/src/test/org/apache/solr/search/join/BlockJoinNestedVectorsQParserTest.java b/solr/core/src/test/org/apache/solr/search/join/BlockJoinNestedVectorsQParserTest.java
index 176aaf224c1..1243d4f7fae 100644
--- a/solr/core/src/test/org/apache/solr/search/join/BlockJoinNestedVectorsQParserTest.java
+++ b/solr/core/src/test/org/apache/solr/search/join/BlockJoinNestedVectorsQParserTest.java
@@ -294,6 +294,23 @@ public class BlockJoinNestedVectorsQParserTest extends SolrTestCaseJ4 {
"//result/doc[3]/str[@name='id'][.='2']");
}
+ @Test
+ public void parentRetrievalByte_knnChildrenWithMultipleParentFilters_shouldReturnKnnParents() {
+ assertQ(
+ req(
+ "q", "{!parent which=$allParents score=max v=$children.q}",
+ "fl", "id,score",
+ "children.q",
+ "{!knn f=vector_byte topK=3 parents.preFilter=$parentFilter1 parents.preFilter=$parentFilter2 childrenOf=$allParents}"
+ + BYTE_QUERY_VECTOR,
+ "allParents", "parent_s:[* TO *]",
+ "parentFilter1", "parent_s:(a c)",
+ "parentFilter2", "parent_s:(c e)"),
+ "//*[@numFound='2']",
+ "//result/doc[1]/str[@name='id'][.='8']",
+ "//result/doc[2]/str[@name='id'][.='2']");
+ }
+
@Test
public void
parentRetrievalByte_knnChildrenWithParentFilterAndChildrenFilter_shouldReturnKnnParents() {
@@ -311,6 +328,24 @@ public class BlockJoinNestedVectorsQParserTest extends SolrTestCaseJ4 {
"//result/doc[2]/str[@name='id'][.='2']");
}
+ @Test
+ public void
+ parentRetrievalByte_knnChildrenWithMultipleParentFiltersAndChildrenFilter_shouldReturnKnnParents() {
+ assertQ(
+ req(
+ "q", "{!parent which=$allParents score=max v=$children.q}",
+ "fl", "id,score",
+ "children.q",
+ "{!knn f=vector_byte topK=3 preFilter=child_s:m parents.preFilter=$parentFilter1 parents.preFilter=$parentFilter2 childrenOf=$allParents}"
+ + BYTE_QUERY_VECTOR,
+ "allParents", "parent_s:[* TO *]",
+ "parentFilter1", "parent_s:(a c)",
+ "parentFilter2", "parent_s:(c e)"),
+ "//*[@numFound='2']",
+ "//result/doc[1]/str[@name='id'][.='8']",
+ "//result/doc[2]/str[@name='id'][.='2']");
+ }
+
@Test
public void
parentRetrievalFloat_topKWithChildTransformerWithFilter_shouldUseOriginalChildTransformerFilter() {