java.lang.Object
org.elasticsearch.search.aggregations.bucket.filter.QueryToFilterAdapter

public class QueryToFilterAdapter extends Object
Adapts a Lucene Query to the behaviors used be the FiltersAggregator. In general we try to delegate to Query when we don't have a special optimization.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    build(org.apache.lucene.search.IndexSearcher searcher, String key, org.apache.lucene.search.Query query)
    Build a filter for the query against the provided searcher.
    boolean
    Is this an inefficient union of the top level query with the filter? If the top level query if complex we can't efficiently merge it with the filter.
    final String
    key()
    Key for this filter.
    protected final org.apache.lucene.search.IndexSearcher
    Searcher that this filter is targeting.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • segmentsCountedInConstantTime

      protected int segmentsCountedInConstantTime
  • Method Details

    • build

      public static QueryToFilterAdapter build(org.apache.lucene.search.IndexSearcher searcher, String key, org.apache.lucene.search.Query query) throws IOException
      Build a filter for the query against the provided searcher.

      Note: This method rewrites the query against the IndexSearcher

      Throws:
      IOException
    • isInefficientUnion

      public boolean isInefficientUnion()
      Is this an inefficient union of the top level query with the filter? If the top level query if complex we can't efficiently merge it with the filter. If we can't do that it is likely faster to just run the "native" aggregation implementation rather than go filter by filter.
    • key

      public final String key()
      Key for this filter.
    • searcher

      protected final org.apache.lucene.search.IndexSearcher searcher()
      Searcher that this filter is targeting.