lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Early Termination of Queries
Date Tue, 18 Apr 2017 21:03:53 GMT
Each segment in Lucene is its own little index, and you can get the
SegmentReader for it (use IndexReader.leaves() API from the full reader you
opened), pass that to IndexSearcher, and search it.

But be careful: the "last" segment is an unpredictable thing, because the
default merge policy merges segments out of order, so you can't know in
general what documents are in it, how large it will be, etc.

Mike McCandless

On Tue, Apr 18, 2017 at 6:07 AM, aravinth thangasami <> wrote:

> Hi all,
> *EarlyTerminatingSortingCollector* in lucene takes N documents from each
> segment. I have a case where i need to get the result from latest
> segment alone will be enough to provide the results.
> On finding N results in latest segment i will stop searching
> What is your opinion on this ??
> will this is possible ???
> Thanks
> Aravinth

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message