Interface TermsAggregationOptionsStep<S extends TermsAggregationOptionsStep<?,PDF,F,A>,PDF extends SearchPredicateFactory,F,A>

Type Parameters:
S - The "self" type (the actual exposed type of this step).
PDF - The type of factory used to create predicates in AggregationFilterStep.filter(Function).
F - The type of the targeted field.
A - The type of result for this aggregation.
All Superinterfaces:
AggregationFilterStep<S,PDF>, AggregationFinalStep<A>

public interface TermsAggregationOptionsStep<S extends TermsAggregationOptionsStep<?,PDF,F,A>,PDF extends SearchPredicateFactory,F,A> extends AggregationFinalStep<A>, AggregationFilterStep<S,PDF>
The final step in a "terms" aggregation definition, where optional parameters can be set.
  • Method Summary

    Modifier and Type
    Method
    Description
    maxTermCount(int maxTermCount)
    Requires to only create buckets for the top maxTermCount most frequent terms.
    minDocumentCount(int minDocumentCount)
    Eliminates buckets with less than minDocumentCount matching documents from the aggregation result.
    Order buckets by ascending document count in the aggregation result.
    Order buckets by descending document count in the aggregation result.
    Order buckets by ascending term value in the aggregation result.
    Order buckets by descending term value in the aggregation result.

    Methods inherited from interface org.hibernate.search.engine.search.aggregation.dsl.AggregationFilterStep

    filter, filter, filter

    Methods inherited from interface org.hibernate.search.engine.search.aggregation.dsl.AggregationFinalStep

    toAggregation
  • Method Details

    • orderByCountDescending

      S orderByCountDescending()
      Order buckets by descending document count in the aggregation result.

      This is the default behavior.

      Returns:
      this, for method chaining.
    • orderByCountAscending

      S orderByCountAscending()
      Order buckets by ascending document count in the aggregation result.
      Returns:
      this, for method chaining.
    • orderByTermAscending

      S orderByTermAscending()
      Order buckets by ascending term value in the aggregation result.
      Returns:
      this, for method chaining.
    • orderByTermDescending

      S orderByTermDescending()
      Order buckets by descending term value in the aggregation result.
      Returns:
      this, for method chaining.
    • minDocumentCount

      S minDocumentCount(int minDocumentCount)
      Eliminates buckets with less than minDocumentCount matching documents from the aggregation result.

      If set to 0, terms that are present in the index, but are not referenced in any document matched by the search query will yield a bucket with a document count of zero.

      Defaults to 1.

      Parameters:
      minDocumentCount - The minimum document count for each aggregation value.
      Returns:
      this, for method chaining.
    • maxTermCount

      S maxTermCount(int maxTermCount)
      Requires to only create buckets for the top maxTermCount most frequent terms.

      Defaults to 100.

      Parameters:
      maxTermCount - The maximum number of reported terms.
      Returns:
      this, for method chaining.