Module org.elasticsearch.server
Class QueryToFilterAdapter
java.lang.Object
org.elasticsearch.search.aggregations.bucket.filter.QueryToFilterAdapter
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic QueryToFilterAdapter
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()
Searcher that this filter is targeting.
-
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
Key for this filter. -
searcher
protected final org.apache.lucene.search.IndexSearcher searcher()Searcher that this filter is targeting.
-