org.apache.lucene.search

## Class FilteredDocIdSet

- java.lang.Object
- - org.apache.lucene.search.DocIdSet
  - - org.apache.lucene.search.FilteredDocIdSet

- All Implemented Interfaces:
    Accountable
  Direct Known Subclasses:
    BitsFilteredDocIdSet

  Deprecated.
  This class is not useful internally anymore and will be removed in 6.0

      @Deprecated
      public abstract class FilteredDocIdSet
      extends DocIdSet

  Abstract decorator class for a DocIdSet implementation that provides on-demand filtering/validation mechanism on a given DocIdSet.

  Technically, this same functionality could be achieved with ChainedFilter (under queries/), however the benefit of this class is it never materializes the full bitset for the filter. Instead, the `match(int)` method is invoked on-demand, per docID visited during searching. If you know few docIDs will be visited, and the logic behind `match(int)` is relatively costly, this may be a better way to filter than ChainedFilter.

  See Also:
    `DocIdSet`

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.search.DocIdSet

      `EMPTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilteredDocIdSet(DocIdSet innerSet)` Deprecated. Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Bits` | `bits()` Deprecated. Optionally provides a `Bits` interface for random access to matching documents.
    `Collection<Accountable>` | `getChildResources()` Deprecated. Returns nested resources of this class.
    `DocIdSet` | `getDelegate()` Deprecated. Return the wrapped `DocIdSet`.
    `boolean` | `isCacheable()` Deprecated. This DocIdSet implementation is cacheable if the inner set is cacheable.
    `DocIdSetIterator` | `iterator()` Deprecated. Implementation of the contract to build a DocIdSetIterator.
    `protected abstract boolean` | `match(int docid)` Deprecated. Validation method to determine whether a docid should be in the result set.
    `long` | `ramBytesUsed()` Deprecated. Return the memory usage of this object in bytes.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FilteredDocIdSet

          public FilteredDocIdSet(DocIdSet innerSet)

      Deprecated.
      Constructor.
      Parameters:
        `innerSet` - Underlying DocIdSet

  - ### Method Detail

    - #### getDelegate

          public DocIdSet getDelegate()

      Deprecated.
      Return the wrapped `DocIdSet`.

    - #### isCacheable

          public boolean isCacheable()

      Deprecated.
      This DocIdSet implementation is cacheable if the inner set is cacheable.
      Overrides:
        `isCacheable` in class `DocIdSet`

    - #### ramBytesUsed

          public long ramBytesUsed()

      Deprecated.
      Description copied from interface: `Accountable`
      Return the memory usage of this object in bytes. Negative values are illegal.

    - #### getChildResources

          public Collection<Accountable> getChildResources()

      Deprecated.
      Description copied from interface: `Accountable`
      Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).
      Specified by:
        `getChildResources` in interface `Accountable`
      Overrides:
        `getChildResources` in class `DocIdSet`
      See Also:
        `Accountables`

    - #### bits

          public Bits bits()
                    throws IOException

      Deprecated.
      Description copied from class: `DocIdSet`
      Optionally provides a `Bits` interface for random access to matching documents.
      Overrides:
        `bits` in class `DocIdSet`
      Returns:
        `null`, if this `DocIdSet` does not support random access. In contrast to `DocIdSet.iterator()`, a return value of `null` does not imply that no documents match the filter! The default implementation does not provide random access, so you only need to implement this method if your DocIdSet can guarantee random access to every docid in O(1) time without external disk access (as `Bits` interface cannot throw `IOException`). This is generally true for bit sets like `FixedBitSet`, which return itself if they are used as `DocIdSet`.
      Throws:
        `IOException`

    - #### match

          protected abstract boolean match(int docid)

      Deprecated.
      Validation method to determine whether a docid should be in the result set.
      Parameters:
        `docid` - docid to be tested
      Returns:
        true if input docid should be in the result set, false otherwise.

    - #### iterator

          public DocIdSetIterator iterator()
                                    throws IOException

      Deprecated.
      Implementation of the contract to build a DocIdSetIterator.
      Specified by:
        `iterator` in class `DocIdSet`
      Throws:
        `IOException`
      See Also:
        `DocIdSetIterator`, `FilteredDocIdSetIterator`

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.