RE: Extracting all documents for a given search

2011-09-19 Thread Uwe Schindler
> Ahem, sorry. I quoted an old answer of mine, but HitCollector has been gone > for a while now... > This is the modern version: > > final ArrayList docs = new ArrayList(); > searcher.search( query, new Collector() { private int docBase; *// ignore > scorer* > >public void setScorer(Scorer s

Re: Extracting all documents for a given search

2011-09-19 Thread Israel Tsadok
Ahem, sorry. I quoted an old answer of mine, but HitCollector has been gone for a while now... This is the modern version: final ArrayList docs = new ArrayList(); searcher.search( query, new Collector() { private int docBase; *// ignore scorer* public void setScorer(Scorer scorer) { }

Re: Extracting all documents for a given search

2011-09-19 Thread Toke Eskildsen
On Sat, 2011-09-17 at 03:57 +0200, Charlie Hubbard wrote: > I really just want to be called back when a new document is found by the > searcher, and I can load the Document, find my object, and drop that to a > file. I thought that's essentially what a Collector is, being an interface > that is c

Re: Extracting all documents for a given search

2011-09-19 Thread Israel Tsadok
If you just want to fetch all the matching documents for a given query, implement a collector that just saves the document data. final ArrayList docs = new ArrayList(); searcher.search( query, new HitCollector() { public void collect(int doc, float score) { docs.add(searcher.doc(doc));

RE: Extracting all documents for a given search

2011-09-18 Thread Uwe Schindler
://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Trejkaz [mailto:trej...@trypticon.org] > Sent: Monday, September 19, 2011 8:10 AM > To: java-user@lucene.apache.org > Subject: Re: Extracting all documents for a given search > > On Mon, Se

Re: Extracting all documents for a given search

2011-09-18 Thread Trejkaz
On Mon, Sep 19, 2011 at 3:50 AM, Charlie Hubbard wrote: > Here was the prior API I was calling: > >        Hits hits = getSearcher().search( query, filter, sort ); > > The new API: > >        TopDocs hits = getSearcher().search( query, filter, startDoc + > length, sort ); > > So the question is wh

Re: Extracting all documents for a given search

2011-09-18 Thread Charlie Hubbard
Here was the prior API I was calling: Hits hits = getSearcher().search( query, filter, sort ); The new API: TopDocs hits = getSearcher().search( query, filter, startDoc + length, sort ); So the question is what new API can I use that allows me to extract all documents matching t

Re: Extracting all documents for a given search

2011-09-17 Thread Chris Hostetter
: I'm trying to reimplement a feature I had under 2.x in 3.x. I have a : feature where a zip file for all of the documents returned by a search can : be exported. Now with the newer APIs you have to put an upper limit on the if you start by explaining what API you were using before, people can

Re: Extracting all documents for a given search

2011-09-16 Thread Charlie Hubbard
Ah because that will easily toss an out of memory exception. Besides I already tried it. I don't want a huge array holding all of those documents. I really just want to be called back when a new document is found by the searcher, and I can load the Document, find my object, and drop that to a fi

Re: Extracting all documents for a given search

2011-09-16 Thread Eddie Drapkin
On 9/16/2011 11:30 AM, Charlie Hubbard wrote: I'm trying to reimplement a feature I had under 2.x in 3.x. I have a feature where a zip file for all of the documents returned by a search can be exported. Now with the newer APIs you have to put an upper limit on the search so it won't return more