I believe I understand the *purpose* of the
DiversifyingChildrenFloatKnnVectorQuery (and
DiversifyingChildrenByteKnnVectorQuery) classes, but what I don't
understand is the java code example from the javadocs...
https://lucene.apache.org/core/9_12_0/join/org/apache/lucene/search/join/DiversifyingChildrenFloatKnnVectorQuery.html
Query knnQuery = new DiversifyingChildrenFloatKnnVectorQuery(fieldName,
queryVector, ...);
// Rewrite executes kNN search and collects nearest children docIds and their
scores
Query rewrittenKnnQuery = searcher.rewrite(knnQuery);
// Join the scored children docs with their parents and score the parents
Query childrenToParents = new ToParentBlockJoinQuery(rewrittenKnnQuery,
parentsFilter, ScoreMode.MAX);
...why does this example suggest that the "caller" needs to call
searcher.rewrite(knnQuery) directly and then pass the result to the
ToParentBlockJoinQuery constructor? Isn't that rewrite going to happen
automatically when ToParentBlockJoinQuery.rewrite() is ultimately called?
Also, FWIW, I can't sem to find any tests this particular
method of combining DiversifyingChildrenFloatKnnVectorQuery with
ToParentBlockJoinQuery produces expected results -- making me suspicios
that it's not actaully neccessary for correct behavior?
(Allthough, for that matter, I'm not seeing any tests that actual involve
wrapping DiversifyingChildrenFloatKnnVectorQuery in a
ToParentBlockJoinQuery -- only lower level "white box" style tests that
assert DiversifyingChildrenFloatKnnVectorQuery returns the expected
diverse matches)
-Hoss
http://www.lucidworks.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org