lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toke Eskildsen ...@statsbiblioteket.dk>
Subject Re: Extracting all documents for a given search
Date Mon, 19 Sep 2011 08:40:15 GMT
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 called back whenever it encounters a Document that matches a query.

That is correct. It is a simple API so implementing your own
ZIPCollector seems to be the best solution. Partly copied from Trejkaz:

    class ZIPCollector extends Collector {
        public void collect(int doc) {
            addZIPContent(resolveDocumentContent(doc));
        }
    }

    ZIPCollector collector = new ZIPColelctor();
    getSearcher().search(query, filter, collector);



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message