There are (at least) two ways to generate a BitSet which can be used for
filtering.
Filter.bits()
BitSet bits = new BitSet(reader.maxDoc());
TermDocs td = reader.termDocs(new Term("field", "text");
while (td.next())
{
bits.set(td.doc());
}
return bits;
and HitCollector.collect(), as suggested in Javadocs
final BitSet bits = new BitSet(indexReader.maxDoc());
searcher.search(query, new HitCollector() {
public void collect(int doc, float score) {
bits.set(doc);
}
});
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?
Antony
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]