lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Vasilev <ivasi...@sirma.bg>
Subject Re: Best way for paging with TopDocs class?
Date Fri, 17 Apr 2009 08:49:04 GMT
Hi Alex,

As I know HitColector is useful when you need to deal with some data of 
ALL the docs in the index, but when you need just top of them 
HitCollector is said to be a performance killer. Then is better to use 
Hits with the old API and TopDocs with current one.

Ivan

AlexElba wrote:
> Why you don't extend to HitCollector  and put all logic you need into it?
>
>
>
>
> Ivan Vasilev-2 wrote:
>   
>> Hi All,
>>
>> As Hits class was deprecated in current Lucene and is expected to be 
>> excluded from Lucene 3.0 we decided to change our code so that to use 
>> TopDocs class.
>> Our app provides paging and now we are uondering what is the bset way to 
>> do it with th TopDocs. I can see only this possibility:
>> 1. User opens page 1 - we load by searcher.search(..., docNum, ... ) 
>> method as many docs as for page 1;
>> 2. User opens page 2 - we load as many results as the amount for page 1 
>> and page 2 (note that docs for page 1 are loaded again);
>> ...
>> N. User opens page n - we load as many docs as the amount of all pages 
>> from #1 to #N (note that page 1 docs were loaded N-1 times, page 2 docs 
>> N-2 times etc).
>>
>> With Hits class this loading of documents of previous pages was avoided 
>> - they were loaded once and when needed docs for the next page Hits just 
>> loaded the next portion of docs without reloading the previous pages.
>>
>> So my question is:
>> Is there better way for paging with the class TopDocs than the one that 
>> I describe here?
>>
>> Thanks in Advance,
>> Ivan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>
>>     
>
>   


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