Re: pagination with searchAfter

2022-09-24 Thread Robert Muir
You don't need a server-side cache as the searchAfter value has all the information, it is just your "current position". For example if you are sorting by ID and you return IDs 1,2,3,4,5, the searchAfter value is basically 5. So when you query the next time with that searchAfter=5, it skips over an

Re: Pagination using searchAfter

2015-09-04 Thread Chris Hostetter
: I want to use the searchAfter API in IndexSearcher. This API takes ScoreDoc as : argument. Do we need to store the last ScoreDoc value (ScoreDoc value from : previous search)? When multiple users perform search, then it might be : difficult to store the last ScoreDoc value. : : I guess, docid v

Re: Pagination using searchAfter

2015-09-04 Thread jamie
Ganesh I would advise to consult Lucene user group archives. I asked a similar question a while back, and it was addressed. Cheers Jamie On 2015/09/04 4:56 PM, Ganesh wrote: Hi I want to use the searchAfter API in IndexSearcher. This API takes ScoreDoc as argument. Do we need to store the

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
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

Re: pagination search results

2009-05-13 Thread Nate
ress.com > > --- On Tue, 5/12/09, Ian Lea wrote: > > From: Ian Lea > Subject: Re: pagination search results > To: java-user@lucene.apache.org > Date: Tuesday, May 12, 2009, 3:10 PM > > See the FAQ entry "How do I implement paging, i.e. showing result from > 1-10,

Re: pagination search results

2009-05-13 Thread Daniel Susanto
Do you have any example for that?? I'm using JSP, what i need is paging just like in google search... :D thx Daniel Susanto http://susantodaniel.wordpress.com --- On Tue, 5/12/09, Ian Lea wrote: From: Ian Lea Subject: Re: pagination search results To: java-user@lucene.apache.org

Re: pagination search results

2009-05-12 Thread Ian Lea
See the FAQ entry "How do I implement paging, i.e. showing result from 1-10, 11-20 etc?". -- Ian. On Tue, May 12, 2009 at 6:37 AM, Daniel Susanto wrote: > Hi, > > Please help, how to do pagination search results? > > note: i'm using Java Server Pages. > > thx. > > Daniel Susanto > http://susan

Re: Pagination with MultiSearcher

2009-03-19 Thread Amin Mohammed-Coleman
Hi Please ignore the problem I raised. User error ! Sorry Amin On 19 Mar 2009, at 09:41, Amin Mohammed-Coleman wrote: Hi I've implemented the solution using the PageHitCounter from the link and I have noticed that in certain instances I get a 0 score for queries like "document OR as

Re: Pagination with MultiSearcher

2009-03-19 Thread Amin Mohammed-Coleman
Hi I've implemented the solution using the PageHitCounter from the link and I have noticed that in certain instances I get a 0 score for queries like "document OR aspectj". has anyone else experienced this? Cheers Amin On Mon, Mar 16, 2009 at 8:07 PM, Amin Mohammed-Coleman wrote: > Hi > I've c

Re: Pagination with MultiSearcher

2009-03-16 Thread Amin Mohammed-Coleman
Hi I've come across the PageHitCollector class from the: http://mail-archives.apache.org/mod_mbox/lucene-java-user/200707.mbox/%3c070320071521.6119.468a6964000b3e7517e72205884484070a9c0701030...@comcast.net%3e I'm looking at using this in the multisearcher class, and do: search(query,filter,

Re: Pagination with MultiSearcher

2009-03-16 Thread Amin Mohammed-Coleman
Hi Erick I've seen the following: TopDocCollector collector = new TopDocCollector(hitsPerPage) and then pass the collector to the seacher. But I'm not sure how I increment the hitsPerPage. Also how do I get the total results returned? In relation to sorting I could basically use Collections.so

Re: Pagination with MultiSearcher

2009-03-15 Thread Erick Erickson
Basically, the FileSortedHitQueue is just a sorting mechanism you implement yourself. But I can't help but think that there's an easier way, although I'll have to admit I haven't used MultiSearcher enough to offer much guidance. That'll teach me to send something off on Sunday that I don't real

Re: Pagination with MultiSearcher

2009-03-15 Thread Amin Mohammed-Coleman
HI Erick Thanks for your reply, glad to see I'm not the only person working/developing on a Sunday! I'm not sure how the FieldSortedHitQueue works and how it can be applied to the search method exposed by MultiSearcher. Would it be possible to clarify abit more or even point to some reference doc

Re: Pagination with MultiSearcher

2009-03-15 Thread Erick Erickson
You could do something with FieldSortedHitQueue as a post-search sort, but I wonder if this would work for you... public TopFieldDocs *search*(Query

RE: Pagination ...

2007-12-27 Thread Dragon Fly
Thanks. Date: Wed, 26 Dec 2007 13:07:03 -0500 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Pagination ... CC: java-user@lucene.apache.org You might want to take a look at Solr (http://lucene.apache.org/solr/). You could either use Solr directly, or see how they implement paging

Re: Pagination ...

2007-12-26 Thread Mike Richmond
You might want to take a look at Solr (http://lucene.apache.org/solr/). You could either use Solr directly, or see how they implement paging. --Mike On Dec 26, 2007 12:12 PM, Zhou Qi <[EMAIL PROTECTED]> wrote: > Using the search function for pagination will carry out unnecessary index > searc

Re: Pagination ...

2007-12-26 Thread Zhou Qi
Using the search function for pagination will carry out unnecessary index search when you are going previous or next. Generally, most of the information need (e.g 80%) can be satisfied by the first 100 documents (20%). In lucene, the returing documents is set to 100 for the sake of speed. I am not

RE: Pagination ...

2007-12-26 Thread Dragon Fly
Any advice on this? Thanks. > From: [EMAIL PROTECTED] > To: java-user@lucene.apache.org > Subject: Pagination ... > Date: Sat, 22 Dec 2007 10:19:30 -0500 > > > Hi, > > What is the most efficient way to do pagination in Lucene? I have always done > the following because this "flavor" of the se

Re: Pagination

2007-07-04 Thread markharw00d
It looks that we may have different cases. I was hoping to answer the original question which was how to retrieve pages of matching documents from a Lucene index (no database mentioned). >>So far worked just fine. I have 5000 rows of items and I think will still work fine later when I'd have

Re: Pagination

2007-07-03 Thread mark harwood
na <[EMAIL PROTECTED]> To: java-user@lucene.apache.org Sent: Tuesday, 3 July, 2007 5:17:51 PM Subject: Re: Pagination Mark, Thanks for the code. Well..I´m doing the same thing you are: Retrieve some Doc IDs and then use the code - Document doc=searcher.doc(sd[i].doc) - to get the Docum

Re: Pagination

2007-07-03 Thread Alixandre Santana
Mark, Thanks for the code. Well..I´m doing the same thing you are: Retrieve some Doc IDs and then use the code - Document doc=searcher.doc(sd[i].doc) - to get the Document itself. But in this case, we are doing a search to get the IDs, and "n" searches to get the Documents, which is not a good

Re: Pagination

2007-07-03 Thread mcmoisei
It looks that we may have different cases. What I do I index my items prior to insert them into the database. When I do a search I get the ids that have the best match and then lookup the items from the database. So far worked just fine. I have 5000 rows of items and I think will still work fi

Re: Pagination

2007-07-03 Thread mark harwood
>>I get the ids then I do look the items in the database using select item.* >>from item where item.id in ( ids ) Hmm. That's likely to confuse the already confused :) The ids referred to so far are Lucene internal document ids and are typically only meaningful to Lucene during a single IndexRea

RE: Pagination

2007-07-03 Thread mcmoisei
as Alixandre. How do I get the content of the > document instead of the document id? > > Thanks. > > Regards, > Lee Li Bin > -Original Message- > From: Alixandre Santana [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 03, 2007 12:55 AM > To: java-user@lu

RE: Pagination

2007-07-02 Thread Lee Li Bin
s HitQueue extends PriorityQueue > { > public HitQueue(int size) > { > initialize(size); > } > public final boolean lessThan(Object a, Object b) > { > ScoreDoc hitA = (ScoreDoc)a; > Score

RE: Pagination

2007-07-02 Thread Lee Li Bin
@lucene.apache.org Subject: Re: Pagination Mark, The ScoreDoc[] contains only the IDs of each lucene document. what would be the best way of getting the entire (lucene)document ? Should i do a new search with the ID retrivied by hpc.getScores() - (searcher.doc(idDoc))? thanks. Alixandre On 7/2/07

Re: Pagination

2007-07-02 Thread Alixandre Santana
ore == hitB.score) return hitA.doc > hitB.doc; else return hitA.score < hitB.score; } } } - Original Message From: Lee Li Bin <[EMAIL PROTECTED]> To: java-user@lucene.apache.org Sent: Monday, 2 July, 2007 9:59:14 AM Subject: RE: Pagination H

Re: Pagination

2007-07-02 Thread mark harwood
hitB.score) return hitA.doc > hitB.doc; else return hitA.score < hitB.score; } } } - Original Message ---- From: Lee Li Bin <[EMAIL PROTECTED]> To: java-user@lucene.apache.org Sent: Monday, 2 July, 2007 9:59:14 AM Subject: RE: Paginati

RE: Pagination

2007-07-02 Thread Lee Li Bin
: Re: Pagination After search, you will just get an object Hits, and go through all of the documents by hits.doc(i). The pagination is controlled by you. Lucene is pre-caching first 200 documents and lazy loading the rest by batch size 200. -- Chris Lu - Instant Scalable

Re: Pagination

2007-06-29 Thread Chris Lu
After search, you will just get an object Hits, and go through all of the documents by hits.doc(i). The pagination is controlled by you. Lucene is pre-caching first 200 documents and lazy loading the rest by batch size 200. -- Chris Lu - Instant Scalable Full-Text Search

Re: pagination

2007-02-22 Thread Peter W.
13:08 To: java-user@lucene.apache.org Subject: Re: pagination See TopDocs, HitCollector, etc. Don't iterate through a Hits objects to get docs beyond, say, 100 since it's designed to efficiently return the first 100 documents but re-executes the queries each 100 or so times you advance to the

Re: pagination

2007-02-21 Thread Erik Hatcher
I'll add that in a web application that using Hits to page through results is perfectly acceptable. Going to these other APIs is a bit more complicated and often unnecessary. Don't prematurely optimize! :) Erik On Feb 21, 2007, at 8:07 AM, Erick Erickson wrote: See TopDocs, HitC

Re: pagination

2007-02-21 Thread Mohammad Norouzi
Hi I've overcome this problem without HitCollector, I build an interface just like java.sql.ResultSet and its implementation class accept a Hits as parameter and provide next() previous() etc. method to navigate between records. in my opinion this is a good solution. Hope this help you On 2/21/0

RE: pagination

2007-02-21 Thread Kainth, Sachin
e.org Subject: Re: pagination See TopDocs, HitCollector, etc. Don't iterate through a Hits objects to get docs beyond, say, 100 since it's designed to efficiently return the first 100 documents but re-executes the queries each 100 or so times you advance to the next document. Erick On

Re: pagination

2007-02-21 Thread Erick Erickson
See TopDocs, HitCollector, etc. Don't iterate through a Hits objects to get docs beyond, say, 100 since it's designed to efficiently return the first 100 documents but re-executes the queries each 100 or so times you advance to the next document. Erick On 2/21/07, Kainth, Sachin <[EMAIL PROTECTE