Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

HitCollector

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


cambazz at gmail

Jan 22, 2008, 9:37 AM

Post #1 of 1 (705 views)
Permalink
HitCollector

Hello,

Could someone show me a concrete example of how to use HitCollector?
I have documents which have a field category. When I run a query, I need to
sort results by category as well as count how many hits are there for a
given category.

I understand:

searcher.search(Query, new HitCollector() {
public void collect(int docnum, float score) {
bitSet.add(docNum);
}
}
);


So we now have a bitset that contains docnums.

How do we do sorting and filtering over this, and why is it more efficient
to do it from hits?

Best Regards,
-C.B.

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.