.-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
@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
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*
> >
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
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
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
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,
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
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
Hallo Chris,
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
10 matches
Mail list logo