Hi Greg, I agree that LeafCollector implementations should be able to assume that finish() only gets called once. The test framework already makes this assumption: https://github.com/apache/lucene/blob/dfff1e635805ffc61dd6029a8060e2635bfcbdb9/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingLeafCollector.java#L95-L100 .
On Mon, Oct 9, 2023 at 5:38 PM Greg Miller <gsmil...@gmail.com> wrote: > Hey folks- > > I'm curious if anyone has thoughts around idempotency concerns related to > the LeafCollector#finish API added in GH#12380 > <https://github.com/apache/lucene/pull/12380>. My expectation would be > that LeafCollector implementations should be able to assume #finish will > only get called once. In fact, it looks like FacetsCollector is already > making that assumption. > > Is this inline with other folks' expectations? If so, I'm going to, 1) > address a small bug related to drill-sideways that results #finish being > called multiple times on one of the collectors, and 2) propose some > additional javadoc on LeafCollector#finish clarifying this. > > Make sense? > > Cheers, > -Greg > -- Adrien