KeyCursor
class KeyCursor
Candidate keys, in segment order and ascending within each segment.
A key may be reported more than once, by different segments — an updated document is in the newest segment that holds it and in every older one that has not yet compacted it away. That is not a defect to be smoothed over here: the recheck resolves each key against the visible version, so one key reported three times yields one answer, and deduplicating early would cost a set over millions of keys to save the caller a fact it already has to handle.
Valid only while the IndexReader that produced it is open, because the ordinals are read straight off that reader's mappings.