lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jamie <ja...@mailarchiva.com>
Subject Re: search performance
Date Tue, 03 Jun 2014 09:32:30 GMT
Vitaly

Thanks for the contribution. Unfortunately, we cannot use Lucene's 
pagination function, because in reality the user can skip pages to start 
the search at any point, not just from the end of the previous search. 
Even the
first search (without any pagination), with a max of 1000 hits, takes 5 
minutes to complete.

Regards

Jamie
On 2014/06/03, 10:54 AM, Vitaly Funstein wrote:
> Something doesn't quite add up.
>
> TopFieldCollector fieldCollector = TopFieldCollector.create(sort, max,true,
>> false, false, true);
>>
>> We use pagination, so only returning 1000 documents or so at a time.
>>
>>
> You say you are using pagination, yet the API you are using to create your
> collector isn't how you would utilize Lucene's built-in "pagination"
> feature (unless misunderstand the API). If the max is the snippet above is
> 1000, then you're simply returning top 1000 docs every time you execute
> your search. Otherwise... well, could you actually post a bit more of your
> code that runs the search here, in particular?
>
> Assuming that the max is much larger than 1000, however, you could call
> fieldCollector.topDocs(int, int) after accumulating hits using this
> collector, but this won't work multiple times per query execution,
> according to the javadoc. So you either have to re-execute the full search,
> and then get the next chunk of ScoreDocs, or use the proper API for this,
> one that accepts as a parameter the end of the previous page of results,
> i.e. IndexSearcher.searchAfter(ScoreDoc, ...)
>


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


Mime
View raw message