org.hibernate.search.query.engine.impl

## Class QueryFilters

- java.lang.Object
- - org.hibernate.search.query.engine.impl.QueryFilters

-     public final class QueryFilters
      extends Object

  Internal representation for a set of filters to be applied on a query.
  Author:
    Sanne Grinovero

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static QueryFilters` | `EMPTY_FILTERSET`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryFilters(List<Query> filterQueries)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Query` | `filterOrPassthrough(Query queryToFilter)` Will wrap the passed Query into a BooleanQuery to apply all filters as boolean clauses.
    `List<Query>` | `getFilterQueries()`
    `boolean` | `isEmpty()`

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

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

- - ### Field Detail

    - #### EMPTY_FILTERSET

          public static final QueryFilters EMPTY_FILTERSET

  - ### Constructor Detail

    - #### QueryFilters

          public QueryFilters(List<Query> filterQueries)

  - ### Method Detail

    - #### filterOrPassthrough

          public Query filterOrPassthrough(Query queryToFilter)

      Will wrap the passed Query into a BooleanQuery to apply all filters as boolean clauses. Returns the unmodified (same instance) of the input if there are no filters to be applied.
      Parameters:
        `queryToFilter` - The query to be filtered.
      Returns:
        The filtered query.

    - #### getFilterQueries

          public List<Query> getFilterQueries()

      Returns:
        lists all Lucene query instances which should be applied as filters

    - #### isEmpty

          public boolean isEmpty()

      Returns:
        `true` if this contains to filters to be applied.

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved