Documentation
¶
Overview ¶
Package aggregations contains objects and methods for processing Elasticsearch aggregations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidAggType = errors.New("invalid aggregation type")
)
Functions ¶
func ExtractAggregation ¶
ExtractAggregation extracts the named aggregation as the requested type from the search response. If the aggregation cannot be extracted to the type, a non-nil error is returned that will contain details.
func ExtractBuckets ¶ added in v0.98.0
func ExtractBuckets[T BucketTypes](container any) ([]T, error)
ExtractBuckets extracts the bucket object from the aggregation as the given type. If the aggregation cannot be extracted to the type, a non-nil error is returned that will contain details.
Types ¶
type Aggs ¶
type Aggs map[string]types.Aggregations
type BucketTypes ¶ added in v0.98.0
type BucketTypes interface {
types.StringTermsBucket | types.StringRareTermsBucket
}
BucketTypes is a type constraint for all aggregation bucket types.
Click to show internal directories.
Click to hide internal directories.