Class AbstractSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR,S,PDF>,SC extends SearchAggregationIndexScope<?>,PDF extends TypedSearchPredicateFactory<SR>>
- All Implemented Interfaces:
ExtendedSearchAggregationFactory<SR,,S, PDF> SearchAggregationFactory,TypedSearchAggregationFactory<SR>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSearchAggregationFactory(SearchAggregationDslContext<SR, SC, PDF> dslContext) -
Method Summary
Modifier and TypeMethodDescriptionavg()Perform the avg metric aggregation.Starts the definition of a composite aggregation, which will combine multiple given aggregations.composite(SearchAggregation<?>... aggregations) Create an aggregation that will compose aListbased on the given aggregations.count()Perform the count metric aggregation.Deprecated, for removal: This API element is subject to removal in a future version.<T> Textension(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 StringtoAbsolutePath(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, waitMethods inherited from interface org.hibernate.search.engine.search.aggregation.dsl.ExtendedSearchAggregationFactory
withRootMethods inherited from interface org.hibernate.search.engine.search.aggregation.dsl.SearchAggregationFactory
composite
-
Field Details
-
dslContext
protected final SearchAggregationDslContext<SR,SC extends SearchAggregationIndexScope<?>, dslContextPDF extends TypedSearchPredicateFactory<SR>>
-
-
Constructor Details
-
AbstractSearchAggregationFactory
-
-
Method Details
-
range
Description copied from interface:TypedSearchAggregationFactoryPerform 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:
rangein interfaceExtendedSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR, S, PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
rangein interfaceSearchAggregationFactory- Specified by:
rangein interfaceTypedSearchAggregationFactory<SR>- Returns:
- The next step.
-
terms
Description copied from interface:TypedSearchAggregationFactoryPerform 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:
termsin interfaceExtendedSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR, S, PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
termsin interfaceSearchAggregationFactory- Specified by:
termsin interfaceTypedSearchAggregationFactory<SR>- Returns:
- The next step.
-
sum
Description copied from interface:TypedSearchAggregationFactoryPerform the sum metric aggregation.Sums up the field values.
- Specified by:
sumin interfaceExtendedSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR, S, PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
sumin interfaceSearchAggregationFactory- Specified by:
sumin interfaceTypedSearchAggregationFactory<SR>- Returns:
- The next step.
-
min
Description copied from interface:TypedSearchAggregationFactoryPerform the min metric aggregation.Provides the minimum value among the field values.
- Specified by:
minin interfaceExtendedSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR, S, PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
minin interfaceSearchAggregationFactory- Specified by:
minin interfaceTypedSearchAggregationFactory<SR>- Returns:
- The next step.
-
max
Description copied from interface:TypedSearchAggregationFactoryPerform the max metric aggregation.Provides the maximum value among the field values.
- Specified by:
maxin interfaceExtendedSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR, S, PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
maxin interfaceSearchAggregationFactory- Specified by:
maxin interfaceTypedSearchAggregationFactory<SR>- Returns:
- The next step.
-
count
Description copied from interface:TypedSearchAggregationFactoryPerform the count metric aggregation.The following steps allow defining the kind of the count aggregation:
count documentsorcount values.- Specified by:
countin interfaceExtendedSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR, S, PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
countin interfaceSearchAggregationFactory- Specified by:
countin interfaceTypedSearchAggregationFactory<SR>- Returns:
- The next step.
-
countDistinct
@Deprecated(since="8.1", forRemoval=true) public CountDistinctValuesAggregationFieldStep<SR,PDF> countDistinct()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TypedSearchAggregationFactoryPerform the count distinct values metric aggregation.Counts the number of unique field values.
- Specified by:
countDistinctin interfaceExtendedSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR, S, PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
countDistinctin interfaceSearchAggregationFactory- Specified by:
countDistinctin interfaceTypedSearchAggregationFactory<SR>- Returns:
- The next step.
-
avg
Description copied from interface:TypedSearchAggregationFactoryPerform the avg metric aggregation.Calculates the average value of a given numeric or temporal field among the matched documents.
- Specified by:
avgin interfaceExtendedSearchAggregationFactory<SR,S extends ExtendedSearchAggregationFactory<SR, S, PDF>, SC extends SearchAggregationIndexScope<?>> - Specified by:
avgin interfaceSearchAggregationFactory- Specified by:
avgin interfaceTypedSearchAggregationFactory<SR>- Returns:
- the next step.
-
composite
Description copied from interface:SearchAggregationFactoryStarts the definition of a composite aggregation, which will combine multiple given aggregations.- Specified by:
compositein interfaceSearchAggregationFactory- Returns:
- A DSL step where the "composite" aggregation can be defined in more details.
-
composite
Description copied from interface:SearchAggregationFactoryCreate an aggregation that will compose aListbased on the given aggregations.- Specified by:
compositein interfaceSearchAggregationFactory- Parameters:
aggregations- The aggregations used to populate the list, in order.- Returns:
- The "composite" aggregation.
-
withParameters
public <T> AggregationFinalStep<T> withParameters(Function<? super NamedValues, ? extends AggregationFinalStep<T>> aggregationCreator) Description copied from interface:SearchAggregationFactoryDelegating 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:
withParametersin interfaceSearchAggregationFactory- Parameters:
aggregationCreator- The function creating an actual aggregation.- Returns:
- A final DSL step in a parameterized aggregation definition.
-
extension
Description copied from interface:SearchAggregationFactoryExtend the current factory with the given extension, resulting in an extended factory offering different types of aggregations.- Specified by:
extensionin 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:
toAbsolutePathin interfaceSearchAggregationFactory- Parameters:
relativeFieldPath- The path to a field, relative to therootof 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.
-