michaeljmarshall opened a new pull request, #16377:
URL: https://github.com/apache/lucene/pull/16377
### Description
The default bulk() implementation advanced its iterator as a side
effect of construction, unlike Bulk.fromRandomScorerDense/Sparse,
which defer positioning to the first nextDocsAndScores call. Move
the positioning into the returned Bulk to match, and update the
javadoc.
The current behavior is problematic when combining the iterator
with others via conjunction. Given that this API is evolving
and the behavior is split I propose adopting the lazy behavior.
In one case, I hit the following error:
```
Caused by: java.lang.IllegalArgumentException: Sub-iterators of
ConjunctionDISI are not on the same document!
at
ConjunctionDISI.throwSubIteratorsNotOnSameDocument(ConjunctionDISI.java:149)
at ConjunctionDISI.createConjunction(ConjunctionDISI.java:104)
at ConjunctionUtils.intersectScorers(ConjunctionUtils.java:44)
at ConjunctionScorer.<init>(ConjunctionScorer.java:36)
at
BooleanScorerSupplier.requiredBulkScorer(BooleanScorerSupplier.java:453)
at
BooleanScorerSupplier.booleanScorer(BooleanScorerSupplier.java:219)
at BooleanScorerSupplier.bulkScorer(BooleanScorerSupplier.java:177)
```
The tests don't hit this error because it's trivial to confirm that the bulk
call is side effect free.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]