Class ESAcceptDocs

java.lang.Object
org.apache.lucene.search.AcceptDocs
org.elasticsearch.search.vectors.ESAcceptDocs
Direct Known Subclasses:
ESAcceptDocs.BitsAcceptDocs, ESAcceptDocs.ESAcceptDocsAll, ESAcceptDocs.ScorerSupplierAcceptDocs

public abstract sealed class ESAcceptDocs extends org.apache.lucene.search.AcceptDocs permits ESAcceptDocs.ESAcceptDocsAll, ESAcceptDocs.BitsAcceptDocs, ESAcceptDocs.ScorerSupplierAcceptDocs
An extension of AcceptDocs that provides additional methods to get an approximate cost and a BitSet representation of the accepted documents.
  • Constructor Details

    • ESAcceptDocs

      public ESAcceptDocs()
  • Method Details

    • approximateCost

      public abstract int approximateCost() throws IOException
      Returns an approximate cost of the accepted documents. This is generally much cheaper than AcceptDocs.cost(), as implementations may not fully evaluate filters to provide this estimate and may ignore deletions
      Returns:
      the approximate cost
      Throws:
      IOException - if an I/O error occurs
    • getBitSet

      public abstract Optional<org.apache.lucene.util.BitSet> getBitSet() throws IOException
      Returns an optional BitSet representing the accepted documents. If a BitSet representation is not available, returns an empty Optional. An empty optional indicates that there are some accepted documents, but they cannot be represented as a BitSet efficiently. Null implies that all documents are accepted.
      Returns:
      an Optional containing the BitSet of accepted documents, or empty if not available, or null if all documents are accepted
      Throws:
      IOException - if an I/O error occurs