You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by dontspamterry <do...@yahoo.com> on 2007/05/14 19:32:38 UTC

Paging sorted results

Hi there,

Is there a way where I can page through sorted results? Say my query has
1000 hits (sorted by name field), but I want to return only 100 rows at a
time. There was no search API() which takes a hit collector and a Sort, so I
looked at the TopFieldDocCollector, but it only accepts the max number of
hits to collect. Any suggestions how one can do this?

Thanks,
-Terry
-- 
View this message in context: http://www.nabble.com/Paging-sorted-results-tf3753827.html#a10608517
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.


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


Re: Paging sorted results

Posted by dontspamterry <do...@yahoo.com>.
Figured it out before I read your reply. Thanks for your help!

-Terry


markrmiller wrote:
> 
> All you need is the max number. If you want 20-30, get up to 30 and ignore
> 1-20. If you think about it, this is what the system would have to do for
> you anyway (Lucene does not).
> 
> - Mark
> 
> On 5/14/07, dontspamterry <do...@yahoo.com> wrote:
>>
>>
>> Hi there,
>>
>> Is there a way where I can page through sorted results? Say my query has
>> 1000 hits (sorted by name field), but I want to return only 100 rows at a
>> time. There was no search API() which takes a hit collector and a Sort,
>> so
>> I
>> looked at the TopFieldDocCollector, but it only accepts the max number of
>> hits to collect. Any suggestions how one can do this?
>>
>> Thanks,
>> -Terry
>> --
>> View this message in context:
>> http://www.nabble.com/Paging-sorted-results-tf3753827.html#a10608517
>> Sent from the Lucene - Java Developer mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-dev-help@lucene.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Paging-sorted-results-tf3753827.html#a10613597
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.


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


Re: Paging sorted results

Posted by Mark Miller <ma...@gmail.com>.
All you need is the max number. If you want 20-30, get up to 30 and ignore
1-20. If you think about it, this is what the system would have to do for
you anyway (Lucene does not).

- Mark

On 5/14/07, dontspamterry <do...@yahoo.com> wrote:
>
>
> Hi there,
>
> Is there a way where I can page through sorted results? Say my query has
> 1000 hits (sorted by name field), but I want to return only 100 rows at a
> time. There was no search API() which takes a hit collector and a Sort, so
> I
> looked at the TopFieldDocCollector, but it only accepts the max number of
> hits to collect. Any suggestions how one can do this?
>
> Thanks,
> -Terry
> --
> View this message in context:
> http://www.nabble.com/Paging-sorted-results-tf3753827.html#a10608517
> Sent from the Lucene - Java Developer mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>