[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    Re: Early Termination of Queries
From:       Michael McCandless <lucene () mikemccandless ! com>
Date:       2017-04-18 21:03:53
Message-ID: CAL8PwkbVuo+hf8=-ycr6dvXkAJUNJ=fB0rG4TtXpOrNnm2X0+Q () mail ! gmail ! com
[Download RAW message or body]


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

http://blog.mikemccandless.com

On Tue, Apr 18, 2017 at 6:07 AM, aravinth thangasami <
aravinththangasami@gmail.com> 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
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic