lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <>
Subject Performance between Filter and HitCollector?
Date Tue, 13 Mar 2007 04:39:32 GMT
There are (at least) two ways to generate a BitSet which can be used for filtering.


   BitSet bits = new BitSet(reader.maxDoc());
   TermDocs td = reader.termDocs(new Term("field", "text");
   while (
   return bits;

and HitCollector.collect(), as suggested in Javadocs

    final BitSet bits = new BitSet(indexReader.maxDoc());, new HitCollector() {
        public void collect(int doc, float score) {

SOLR seems to use DocSetHitCollector in places which allows the DocSet interface 
to be used rather then plain old BitSet which allows small sets to be optimised, 
but does anyone know the performance implications of using HitCollector, if 
score is not required, against using Filter and then generating a DocSet?


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

View raw message