
cambazz at gmail
Jan 22, 2008, 9:37 AM
Post #1 of 1
(705 views)
Permalink
|
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.
|