Class AbstractSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,PDF>,SC extends SearchAggregationIndexScope<?>,PDF extends SearchPredicateFactory>
- All Implemented Interfaces:
ExtendedSearchAggregationFactory<S,
,PDF> SearchAggregationFactory
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSearchAggregationFactory
(SearchAggregationDslContext<SC, PDF> dslContext) -
Method Summary
Modifier and TypeMethodDescriptionavg()
Perform the avg metric aggregation.count()
Perform the count metric aggregation.Perform the count distinct metric aggregation.<T> T
extension
(SearchAggregationFactoryExtension<T> extension) Extend the current factory with the given extension, resulting in an extended factory offering different types of aggregations.max()
Perform the max metric aggregation.min()
Perform the min metric aggregation.range()
Perform aggregation in range buckets.sum()
Perform the sum metric aggregation.terms()
Perform aggregation in term buckets.final String
toAbsolutePath
(String relativeFieldPath) <T> AggregationFinalStep
<T> withParameters
(Function<? super NamedValues, ? extends AggregationFinalStep<T>> aggregationCreator) Delegating aggregation that creates the actual aggregation at query create time and provides access to query parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.search.engine.search.aggregation.dsl.ExtendedSearchAggregationFactory
withRoot
-
Field Details
-
dslContext
protected final SearchAggregationDslContext<SC extends SearchAggregationIndexScope<?>,PDF extends SearchPredicateFactory> dslContext
-
-
Constructor Details
-
AbstractSearchAggregationFactory
-
-
Method Details
-
range
Description copied from interface:SearchAggregationFactory
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.
- Specified by:
range
in interfaceExtendedSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,
PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
range
in interfaceSearchAggregationFactory
- Returns:
- The next step.
-
terms
Description copied from interface:SearchAggregationFactory
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.
- Specified by:
terms
in interfaceExtendedSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,
PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
terms
in interfaceSearchAggregationFactory
- Returns:
- The next step.
-
sum
Description copied from interface:SearchAggregationFactory
Perform the sum metric aggregation.- Specified by:
sum
in interfaceExtendedSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,
PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
sum
in interfaceSearchAggregationFactory
- Returns:
- The next step.
-
min
Description copied from interface:SearchAggregationFactory
Perform the min metric aggregation.- Specified by:
min
in interfaceExtendedSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,
PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
min
in interfaceSearchAggregationFactory
- Returns:
- The next step.
-
max
Description copied from interface:SearchAggregationFactory
Perform the max metric aggregation.- Specified by:
max
in interfaceExtendedSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,
PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
max
in interfaceSearchAggregationFactory
- Returns:
- The next step.
-
count
Description copied from interface:SearchAggregationFactory
Perform the count metric aggregation.- Specified by:
count
in interfaceExtendedSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,
PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
count
in interfaceSearchAggregationFactory
- Returns:
- The next step.
-
countDistinct
Description copied from interface:SearchAggregationFactory
Perform the count distinct metric aggregation.- Specified by:
countDistinct
in interfaceExtendedSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,
PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
countDistinct
in interfaceSearchAggregationFactory
- Returns:
- The next step.
-
avg
Description copied from interface:SearchAggregationFactory
Perform the avg metric aggregation.- Specified by:
avg
in interfaceExtendedSearchAggregationFactory<S extends ExtendedSearchAggregationFactory<S,
PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
avg
in interfaceSearchAggregationFactory
- Returns:
- the next step.
-
withParameters
public <T> AggregationFinalStep<T> withParameters(Function<? super NamedValues, ? extends AggregationFinalStep<T>> aggregationCreator) Description copied from interface:SearchAggregationFactory
Delegating aggregation that creates the actual aggregation at query create time and provides access to query parameters.Which aggregation exactly to create is defined by a function passed to the arguments of this aggregation.
- Specified by:
withParameters
in interfaceSearchAggregationFactory
- Parameters:
aggregationCreator
- The function creating an actual aggregation.- Returns:
- A final DSL step in a parameterized aggregation definition.
-
extension
Description copied from interface:SearchAggregationFactory
Extend the current factory with the given extension, resulting in an extended factory offering different types of aggregations.- Specified by:
extension
in interfaceSearchAggregationFactory
- Type Parameters:
T
- The type of factory provided by the extension.- Parameters:
extension
- The extension to the aggregation DSL.- Returns:
- The extended factory.
-
toAbsolutePath
- Specified by:
toAbsolutePath
in interfaceSearchAggregationFactory
- Parameters:
relativeFieldPath
- The path to a field, relative to theroot
of this factory.- Returns:
- The absolute path of the field, for use in native aggregations for example. Note the path is returned even if the field doesn't exist.
-