lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karsten F." <>
Subject Re: Faceting, Sort and DocIDSet
Date Sat, 18 Apr 2009 14:57:55 GMT

Hi Dave,

searching and sorting in lucene are two separate functions (if you not want
to sort by relevance).
You will not loss performance if you first search with BitSet as
HitCollector and then sort the result by DateField.
But more easy is to extend TopFieldDocCollector/TopFieldCollector to a
Collector with facet count.

Sujit Pal's implementation of facet count is a good idea if you have a small
amount of facets and a lot documents for each facet.

I know half a dozen of implementations of facet browsing.
To choose the best you have to know:
 - How many different values have the facet? Which kind of value (Integer,
small String, huge String)?
 - More then one value of the facet per document/how many in average?
is also interesting for you.

Best regards

David Seltzer wrote:
> I have a set of indexes, each index contains a month's worth of
> Articles. I need to be able to search the index (sorting by date) and
> then apply access-filters based on the Article Source. I'm also trying
> to get result counts for each Article Source.
> So my questions: 
> 1) How do I use a HitCollector and sort by a field? 
> 2) Is using BitSets the wrong way to quickly generate facet counts? I've
> read about DocIDSets, but I'm not sure how to use them in the same way.
> (I'm basing my faceting technique on Sujit Pal's article
> ml)
> Thanks!
> -Dave

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message