org.apache.lucene.queries

## Class BooleanFilter

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.search.Filter
    - - org.apache.lucene.queries.BooleanFilter

- All Implemented Interfaces:
    Cloneable, Iterable<FilterClause>

  Deprecated.
  Use a `QueryWrapperFilter` on a `BooleanQuery` instead

      @Deprecated
      public class BooleanFilter
      extends Filter
      implements Iterable<FilterClause>

  A container Filter that allows Boolean composition of Filters. Filters are allocated into one of three logical constructs; SHOULD, MUST NOT, MUST The results Filter BitSet is constructed as follows: SHOULD Filters are OR'd together The resulting Filter is NOT'd with the NOT Filters The resulting Filter is AND'd with the MUST Filters

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BooleanFilter()` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(Filter filter, BooleanClause.Occur occur)` Deprecated.
    `void` | `add(FilterClause filterClause)` Deprecated. Adds a new FilterClause to the Boolean Filter container
    `List<FilterClause>` | `clauses()` Deprecated. Returns the list of clauses
    `boolean` | `equals(Object obj)` Deprecated.
    `DocIdSet` | `getDocIdSet(LeafReaderContext context, Bits acceptDocs)` Deprecated. Returns the a DocIdSetIterator representing the Boolean composition of the filters that have been added.
    `int` | `hashCode()` Deprecated.
    `Iterator<FilterClause>` | `iterator()` Deprecated. Returns an iterator on the clauses in this query.
    `String` | `toString(String field)` Deprecated. Prints a user-readable version of this Filter.

    - ### Methods inherited from class org.apache.lucene.search.Filter

      `rewrite`

    - ### Methods inherited from class org.apache.lucene.search.Query

      `clone, createWeight, getBoost, setBoost, toString`

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

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BooleanFilter

          public BooleanFilter()

      Deprecated.

  - ### Method Detail

    - #### getDocIdSet

          public DocIdSet getDocIdSet(LeafReaderContext context,
                             Bits acceptDocs)
                               throws IOException

      Deprecated.
      Returns the a DocIdSetIterator representing the Boolean composition of the filters that have been added.
      Specified by:
        `getDocIdSet` in class `Filter`
      Throws:
        `IOException`

    - #### add

          public void add(FilterClause filterClause)

      Deprecated.
      Adds a new FilterClause to the Boolean Filter container
      Parameters:
        `filterClause` - A FilterClause object containing a Filter and an Occur parameter

    - #### add

          public final void add(Filter filter,
                 BooleanClause.Occur occur)

      Deprecated.

    - #### clauses

          public List<FilterClause> clauses()

      Deprecated.
      Returns the list of clauses

    - #### iterator

          public final Iterator<FilterClause> iterator()

      Deprecated.
      Returns an iterator on the clauses in this query. It implements the `Iterable` interface to make it possible to do:

          for (FilterClause clause : booleanFilter) {}

      Specified by:
        `iterator` in interface `Iterable<FilterClause>`

    - #### equals

          public boolean equals(Object obj)

      Deprecated.
      Overrides:
        `equals` in class `Query`

    - #### hashCode

          public int hashCode()

      Deprecated.
      Overrides:
        `hashCode` in class `Query`

    - #### toString

          public String toString(String field)

      Deprecated.
      Prints a user-readable version of this Filter.
      Specified by:
        `toString` in class `Query`

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