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/04/26 04:39:21 UTC

(solr) branch main updated: 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 main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new f436c26fb66 SOLR-18039: More tests for repeated knn parents.preFilter (#4159)
f436c26fb66 is described below

commit f436c26fb66b1a98c738cf7cde3582678126ae59
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>
---
 .../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() {