You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Rabin Karki <ra...@gmail.com> on 2006/09/08 13:52:08 UTC

Efficient Paging

I am trying to do the paging while displaying the search results. i read
different forums and methods, they suggest that just do the normal searching
and display pages using the hits object thus obtained. In this method same
hit object will be generated every time the index is searched. i don't think
that will be an efficient method if i get a lot of results in a single
search.

So, is there better method than that to do the paging?
Thanks

-- 
Rabin

Re: Efficient Paging

Posted by Jeff Rodenburg <je...@gmail.com>.
Hi Rabin -

Re-executing the search is actually the most efficient manner.  A hits
object that is returned by a search is actually very light.  The display
aspect of iterating through the results is more efficient because you're
pulling information from an index who's reader is now cached.  The hits
object simply contains pointers to other document Ids.  In short, the
re-execution is already helping you in the background.

It's a common misconception, but paging is most efficient by executing the
search each time.

-- j

On 9/8/06, Rabin Karki <ra...@gmail.com> wrote:
>
> I am trying to do the paging while displaying the search results. i read
> different forums and methods, they suggest that just do the normal
> searching
> and display pages using the hits object thus obtained. In this method same
> hit object will be generated every time the index is searched. i don't
> think
> that will be an efficient method if i get a lot of results in a single
> search.
>
> So, is there better method than that to do the paging?
> Thanks
>
> --
> Rabin
>
>