lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Grand <>
Subject Re: Apply Lucene Query on Bits
Date Mon, 05 Dec 2016 14:35:18 GMT
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

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 <> a écrit :

> how to apply a 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)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message