RE: Pagination and Sorting

2009-10-01 Thread Uwe Schindler
.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Anshum [mailto:ansh...@gmail.com] > Sent: Thursday, October 01, 2009 2:31 PM > To: java-user@lucene.apache.org > Subject: Re: Pagination and Sorting > > @Christi

Re: Pagination and Sorting

2009-10-01 Thread Anshum
@Christian : Which version of Lucene are you using? For lucene 2.9 this would work. *__code snippet__* IndexReader r = IndexReader.open("/home/anshum/index/indexname", true); IndexSearcher s = new IndexSearcher(r); QueryParser qp = new QueryParser("testfield",new StopAnalyzer()); Query q = qp.par

RE: Pagination and Sorting

2009-10-01 Thread Uwe Schindler
m: Uwe Schindler [mailto:u...@thetaphi.de] > Sent: Thursday, October 01, 2009 2:25 PM > To: java-user@lucene.apache.org > Subject: RE: Pagination and Sorting > > Hi Chris, > > > Uwe, > > > > > You are using TopDocs incorrectly. Normally you use *not* > >

RE: Pagination and Sorting

2009-10-01 Thread Uwe Schindler
Hi Chris, > Uwe, > > > You are using TopDocs incorrectly. Normally you use *not* > Integer.MAX_VALUE, > > as the upper bound of your pagination window as numer of documents. So > if > > user wants to display documents 90 to 100, just set the number to 100 > docs. > > If the user then goes to docs

RE: Pagination and Sorting

2009-10-01 Thread Uwe Schindler
gt; To: java-user@lucene.apache.org > Subject: Re: Pagination and Sorting > > Hey Christian, > Try what I wrote in the last reply. Would work absolutely fine. Have > tested > that for very large datasets. > -- > Anshum Gupta > Naukri Labs! > http://ai-cafe.blogspot.c

Re: Pagination and Sorting

2009-10-01 Thread Christian Robert
Anshum, > You could get the hits in a collector and pass the sort to the > collector as it would be the collect function that handles the > sorting. > > searcherObject.search(query,collector); > > Hope that gives you some headway. :) Not quite (yet?) ;-) What do you mean by passing the Sort t

Re: Pagination and Sorting

2009-10-01 Thread Anshum
Hey Christian, Try what I wrote in the last reply. Would work absolutely fine. Have tested that for very large datasets. -- Anshum Gupta Naukri Labs! http://ai-cafe.blogspot.com The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw On Thu,

Re: Pagination and Sorting

2009-10-01 Thread Christian Robert
Uwe, > You are using TopDocs incorrectly. Normally you use *not* Integer.MAX_VALUE, > as the upper bound of your pagination window as numer of documents. So if > user wants to display documents 90 to 100, just set the number to 100 docs. > If the user then goes to docs 100 to 110, just reexecute t

Re: Pagination and Sorting

2009-10-01 Thread Anshum
You could get the hits in a collector and pass the sort to the collector as it would be the collect function that handles the sorting. searcherObject.search(query,collector); Hope that gives you some headway. :) -- Anshum Gupta Naukri Labs! http://ai-cafe.blogspot.com The facts expressed here b

RE: Pagination and Sorting

2009-10-01 Thread Uwe Schindler
Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Christian Robert [mailto:cr_use...@arcor.de] > Sent: Thursday, October 01, 2009 1:17 PM > To: java-user@lucene.apache.org > Subject: Pagination and Sor

Pagination and Sorting

2009-10-01 Thread Christian Robert
Hello everybody, I'm looking at quite an interesting challenge right now, so I hope that somebody out there will be able to assist me. What I'm trying to do is returning search results both sorted and paginated. So far I haven't been able to come up with a working solution. Pagination without so