Hi,

SearchAfter always reexecutes the whole query regardless if the index changed 
or is a new index. It just sorts out documents, which are not part of the 
topdocs based on the criteria passed in as the last doc. It does this by 
comparing the docid and score before inserting it into the priority queue.

If the index changed between 2 search requests, searchAfter() still works, but 
it may return different documents.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de

> -----Original Message-----
> From: Rajnish kamboj [mailto:rajnishk7.i...@gmail.com]
> Sent: Monday, August 22, 2016 5:22 PM
> To: java-user@lucene.apache.org
> Subject: Re: searchAfter behavior after reindexing
> 
> Please help me in understanding the behaviour of searchAfter().
> 
> On Sunday 21 August 2016, Rajnish kamboj <rajnishk7.i...@gmail.com>
> wrote:
> 
> > Hi Team
> >
> > What is the searchAfter behavior if index is continuously being updated.
> > Document numbers changes if indexes are updated. Also indexes are
> update
> > on segment merge.
> >
> > Now, Suppose
> > - I am holding a ScoreDoc before index update
> > - Index is updated (document number changes).
> >         (A document number may not be relevant in the context to
> > searchAfter query)
> > - I pass this ScoreDoc to searchAfter.
> >
> > Will searchAfter start after ScoreDoc document number OR it will search
> > from scratch?
> >
> >
> > Regards
> > Rajnish
> >
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to