Paging implementation
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Saturday, March 30, 2002 03:19 PM

How to implement paging with Lucene. I have implemented paging on the results returned by Lucene. But I am not sure if that is slow or if there is any direct better implementation at the time of performing the query on the index.

Re: Paging implementation

Posted By:   korfut_korfut  
Posted On:   Tuesday, April 16, 2002 10:38 AM

hi, i do in this way:

...
hits = searcher.search(query); // run the query

startHit=Integer.parseInt(request.getParameter("start"));

endHit=startHit+10;

for (int i = startHit; i < endHit; i++)

{

Document doc = hits.doc(i);

String doctitle = doc.get("title");

output.append(doctitle+"
");

//wherever you want display

}



bye.
About | Sitemap | Contact