Do I get it right that you have a query that defines a set of visible documents, and you want to make sure that your FilterReader only sees those documents?
If this is the case, then you could use FixedBitSet.or to load the Scorer.iterator() into a FixedBitSet, and then maintain two caches: - one from the core cache key to the bit set of visible documents, - one from the core and deletes cache key to the number of documents in the index, this numDocs could be recomputed by iterating the bit set of visible documents, and counting how many of them are not deleted. Le dim. 4 déc. 2016 à 10:04, Hendrik Dev <hendrikde...@gmail.com> a écrit : > how to apply a org.apache.lucene.search.Query on a given > org.apache.lucene.util.Bits object? > > Background: I have a subclass of > org.apache.lucene.index.FilterLeafReader where i want to filter the > livedocs by applying a query on the "Bits". > > According to javadoc i need also to override numDocs() if i override > getLiveDocs(). So the question extends also to how to filter the > number of documents based on a query (within a FilterLeafReader) >