liangkaiwen commented on code in PR #3316:
URL: https://github.com/apache/solr/pull/3316#discussion_r2035547303


##########
solr/core/src/java/org/apache/solr/search/join/BlockJoinParentQParser.java:
##########
@@ -78,10 +87,89 @@ protected Query noClausesQuery() throws SyntaxError {
     return new BitSetProducerQuery(getBitSetProducer(parseParentFilter()));
   }
 
-  protected Query createQuery(final Query parentList, Query query, String 
scoreMode)
+  protected Query createQuery(final Query allParents, BooleanQuery 
childrenQuery, String scoreMode)
       throws SyntaxError {
-    return new AllParentsAware(
-        query, getBitSetProducer(parentList), 
ScoreModeParser.parse(scoreMode), parentList);
+    List<BooleanClause> childrenClauses = childrenQuery.clauses();
+    if (isByteKnnQuery(childrenClauses)) {
+      BitSetProducer allParentsBitSet = getBitSetProducer(allParents);
+      BooleanQuery parentsFilter = getParentsFilter();
+
+      KnnByteVectorQuery knnChildrenQuery = (KnnByteVectorQuery) 
childrenClauses.get(0).getQuery();
+      String vectorField = knnChildrenQuery.getField();
+      byte[] queryVector = knnChildrenQuery.getTargetCopy();
+      int topK = knnChildrenQuery.getK();
+
+      Query acceptedChildren =
+          getChildrenFilter(knnChildrenQuery.getFilter(), parentsFilter, 
allParentsBitSet);
+
+      Query knnChildren =
+          new DiversifyingChildrenByteKnnVectorQuery(
+              vectorField, queryVector, acceptedChildren, topK, 
allParentsBitSet);
+      return new ToParentBlockJoinQuery(
+          knnChildren, allParentsBitSet, ScoreModeParser.parse(scoreMode));
+    } else if (isFloatKnnQuery(childrenClauses)) {

Review Comment:
   Makes sense. I did not realize the parent class was package private. Maybe 
there's an argument to be made to make it public so as not to introduce this 
kind of branching everywhere, but that's a separate lucene question. This is 
fine



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to