> 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
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) {
}
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
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));
://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
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
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
: 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
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
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
10 matches
Mail list logo