lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: absence of searchAfter method with Collector parameter in Lucene IndexSearcher
Date Fri, 06 Jun 2014 22:00:13 GMT

: I was wondering why there is no search method in lucene Indexsearcher to
: search after last reference by passing collector. Say a method with
: signature like searchAfter(Query query, ScoreDoc after, Collector results).

searchAfter only makes sense if there is a Sort involved -- either 
explicitly or implicitly on "score"

When you use a Collector, even if your collector produces "ScoreDoc" 
objects, a subsequent (hypothetical) 
call searchAfter(Query,ScoreDoc,Collector) would have no idea what the 
meaning of "after" was for that ScoreDoc.

(Even if the ScoreDoc was an instance of FieldDoc that encapsulated the 
values for the sort fields, it doesn't know what the fieldNames are, or 
what the comparator/direction to use against those field+values are to 
know what is "after" them).

So from an API standpoint: it just doesn't make any sense.

if you want searchAfter functionality along with custom Collector logic, 
take a look at things like TopFieldCollector.create(...) which you could 
then wrap in your own Collector.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message