: I want to use the searchAfter API in IndexSearcher. This API takes ScoreDoc as
: argument. Do we need to store the last ScoreDoc value (ScoreDoc value from
: previous search)? When multiple users perform search, then it might be
: difficult to store the last ScoreDoc value.
: 
: I guess, docid value is not valid when the IndexReader is reopened. We have
: multiple users simultaneously querying the index. Every minute the IndexReader
: will be reopened.

1) yes, you do have to keep track of the ScoreDoc/FieldDoc of the last 
result on the last page in order to use searchAfter as designed.

2) the ScoreDoc objects actaully do include the docid, and as such you 
can't reliably use a ScoreDoc from an older reader when doing a 
searchAfter with a newer reader -- the design assumes you keep a 
consistent searcher for each "user"

3) one approach you can take, is to serialise/deserializee all of the 
neccessary info contained in the ScoreDoc to capture all of the 
informatoin about the relative position in the sorted doc set and track 
this per user.  This aproach can work even with re-opeend readers as long 
a the docids is irrelevant -- in order to ensure this, you must garuntee 
that perfect "ties" are impossible (ie: your final sort critera must 
produce a unique value for every document)

This last suggestion is How solr deals with searchAfter using the "cursor" 
API, the code used in solr may be relevant for you to impleemnt your own 
solution using lucene-java directly....

https://cwiki.apache.org/confluence/display/solr/Pagination+of+Results
https://lucidworks.com/blog/coming-soon-to-solr-efficient-cursor-based-iteration-of-large-result-sets/
https://issues.apache.org/jira/browse/SOLR-5463

-Hoss
http://www.lucidworks.com/

---------------------------------------------------------------------
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