Interface SearchAggregationFactory
-
- All Known Subinterfaces:
ElasticsearchSearchAggregationFactory
,ExtendedSearchAggregationFactory<PDF>
,LuceneSearchAggregationFactory
- All Known Implementing Classes:
DelegatingSearchAggregationFactory
public interface SearchAggregationFactory
A factory for search aggregations.- Author:
- Emmanuel Bernard emmanuel@hibernate.org
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
extension(SearchAggregationFactoryExtension<T> extension)
Extend the current factory with the given extension, resulting in an extended factory offering different types of aggregations.RangeAggregationFieldStep<?>
range()
Perform aggregation in range buckets.TermsAggregationFieldStep<?>
terms()
Perform aggregation in term buckets.
-
-
-
Method Detail
-
range
RangeAggregationFieldStep<?> range()
Perform aggregation in range buckets.Given a field and one or more ranges of values, this aggregation creates one bucket per range, and puts in each bucket every document for which the given field has a value that falls into the corresponding range.
For each bucket, the document count is computed, or more complex metrics or sub-aggregations for backends that support it.
- Returns:
- The next step.
-
terms
TermsAggregationFieldStep<?> terms()
Perform aggregation in term buckets.Given a field, this aggregation creates one bucket per term of that field in the index, and puts in each bucket every document for which the given field matches the corresponding term.
For each bucket, the document count is computed, or more complex metrics or sub-aggregations for backends that support it.
- Returns:
- The next step.
-
extension
<T> T extension(SearchAggregationFactoryExtension<T> extension)
Extend the current factory with the given extension, resulting in an extended factory offering different types of aggregations.- Type Parameters:
T
- The type of factory provided by the extension.- Parameters:
extension
- The extension to the aggregation DSL.- Returns:
- The extended factory.
- Throws:
SearchException
- If the extension cannot be applied (wrong underlying backend, ...).
-
-