Hi Wei, Lucene in general iterate through the index in the order of what is recorded in the SegmentInfos <https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java#L140> And at search time, you can specify the order using LeafSorter <https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java#L75> when you're opening the IndexReader
Patrick On Tue, May 2, 2023 at 5:28 PM Wei <weiwan...@gmail.com> wrote: > Hello, > > We have a index that has multiple segments generated with continuous > updates. Does Lucene have a specific order when iterate through the > segments (assuming single query thread) ? Can the order be customized that > the latest generated segments are searched first? > > Thanks, > Wei >