Documentation
¶
Index ¶
- type AvgAgg
- type BaseAgg
- type BaseAggParams
- type CardinalityAgg
- type FilterAggregation
- type MaxAgg
- type MinAgg
- type NestedAggregation
- type PercentilesAgg
- func (agg *PercentilesAgg) Compression(val uint16) *PercentilesAgg
- func (agg *PercentilesAgg) Keyed(b bool) *PercentilesAgg
- func (agg *PercentilesAgg) Map() map[string]interface{}
- func (agg *PercentilesAgg) Missing(val interface{}) *PercentilesAgg
- func (agg *PercentilesAgg) NumHistogramDigits(val uint8) *PercentilesAgg
- func (agg *PercentilesAgg) Percents(percents ...float32) *PercentilesAgg
- type StatsAgg
- type StringStatsAgg
- type SumAgg
- type TermsAggregation
- func (agg *TermsAggregation) Aggs(aggs ...common.Aggregation) *TermsAggregation
- func (agg *TermsAggregation) Include(include ...string) *TermsAggregation
- func (agg *TermsAggregation) Map() map[string]interface{}
- func (agg *TermsAggregation) Name() string
- func (agg *TermsAggregation) Order(order map[string]string) *TermsAggregation
- func (agg *TermsAggregation) ShardSize(size float64) *TermsAggregation
- func (agg *TermsAggregation) ShowTermDocCountError(b bool) *TermsAggregation
- func (agg *TermsAggregation) Size(size uint64) *TermsAggregation
- type TopHitsAgg
- func (agg *TopHitsAgg) From(offset uint64) *TopHitsAgg
- func (agg *TopHitsAgg) Map() map[string]interface{}
- func (agg *TopHitsAgg) Name() string
- func (agg *TopHitsAgg) Size(size uint64) *TopHitsAgg
- func (agg *TopHitsAgg) Sort(name string, order Order) *TopHitsAgg
- func (agg *TopHitsAgg) SourceIncludes(keys ...string) *TopHitsAgg
- type ValueCountAgg
- type WeightedAvgAgg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvgAgg ¶
type AvgAgg struct {
*BaseAgg `structs:",flatten"`
}
AvgAgg represents an aggregation of type "avg", as described in https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-avg-aggregation.html
type BaseAgg ¶
type BaseAgg struct {
*BaseAggParams `structs:",flatten"`
// contains filtered or unexported fields
}
BaseAgg contains several fields that are common for all aggregation types.
type BaseAggParams ¶
type BaseAggParams struct {
// Field is the name of the field to aggregate on.
Field string `structs:"field"`
// Miss is a value to provide for documents that are missing a value for the
// field.
Miss interface{} `structs:"missing,omitempty"`
}
BaseAggParams contains fields that are common to most metric-aggregation types.
type CardinalityAgg ¶
type CardinalityAgg struct {
*BaseAgg `structs:",flatten"`
// PrecisionThr is the precision threshold of the aggregation
PrecisionThr uint16 `structs:"precision_threshold,omitempty"`
}
CardinalityAgg represents an aggregation of type "cardinality", as described in https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-cardinality-aggregation.html
func Cardinality ¶
func Cardinality(name, field string) *CardinalityAgg
Cardinality creates a new aggregation of type "cardinality" with the provided name and on the provided field.
func (*CardinalityAgg) Map ¶
func (agg *CardinalityAgg) Map() map[string]interface{}
Map returns a map representation of the aggregation, thus implementing the Mappable interface
func (*CardinalityAgg) Missing ¶
func (agg *CardinalityAgg) Missing(val interface{}) *CardinalityAgg
Missing sets the value to provide for records that are missing a value for the field.
func (*CardinalityAgg) PrecisionThreshold ¶
func (agg *CardinalityAgg) PrecisionThreshold(val uint16) *CardinalityAgg
PrecisionThreshold sets the precision threshold of the aggregation.
type FilterAggregation ¶
type FilterAggregation struct {
// contains filtered or unexported fields
}
func FilterAgg ¶
func FilterAgg(name string, filter common.Mappable) *FilterAggregation
FilterAgg creates a new common.Aggregation of type "filter". The method name includes the "Agg" suffix to prevent conflict with the "filter" query.
func (*FilterAggregation) Aggs ¶
func (agg *FilterAggregation) Aggs(aggs ...common.Aggregation) *FilterAggregation
Aggs sets sub-common.Aggregations for the common.Aggregation.
func (*FilterAggregation) Filter ¶
func (agg *FilterAggregation) Filter(filter common.Mappable) *FilterAggregation
Filter sets the filter items
func (*FilterAggregation) Map ¶
func (agg *FilterAggregation) Map() map[string]interface{}
func (*FilterAggregation) Name ¶
func (agg *FilterAggregation) Name() string
Name returns the name of the common.Aggregation.
type MaxAgg ¶
type MaxAgg struct {
*BaseAgg `structs:",flatten"`
}
MaxAgg represents an aggregation of type "max", as described in: https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-max-aggregation.html
type MinAgg ¶
type MinAgg struct {
*BaseAgg `structs:",flatten"`
}
MinAgg represents an aggregation of type "min", as described in: https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-min-aggregation.html
type NestedAggregation ¶
type NestedAggregation struct {
// contains filtered or unexported fields
}
func NestedAgg ¶
func NestedAgg(name string, path string) *NestedAggregation
NestedAgg creates a new aggregation of type "nested". The method name includes the "Agg" suffix to prevent conflict with the "nested" query.
func (*NestedAggregation) Aggs ¶
func (agg *NestedAggregation) Aggs(aggs ...common.Aggregation) *NestedAggregation
Aggs sets sub-aggregations for the aggregation.
func (*NestedAggregation) Map ¶
func (agg *NestedAggregation) Map() map[string]interface{}
func (*NestedAggregation) Name ¶
func (agg *NestedAggregation) Name() string
Name returns the name of the aggregation.
func (*NestedAggregation) Path ¶
func (agg *NestedAggregation) Path(p string) *NestedAggregation
Path NumberOfFragments sets the aggregations path
type PercentilesAgg ¶
type PercentilesAgg struct {
*BaseAgg `structs:",flatten"`
// Prcnts is the aggregation's percentages
Prcnts []float32 `structs:"percents,omitempty"`
// Key denotes whether the aggregation is keyed or not
Key *bool `structs:"keyed,omitempty"`
// TDigest includes options for the TDigest algorithm
TDigest struct {
// Compression is the compression level to use
Compression uint16 `structs:"compression,omitempty"`
} `structs:"tdigest,omitempty"`
// HDR includes options for the HDR implementation
HDR struct {
// NumHistogramDigits defines the resolution of values for the histogram
// in number of significant digits
NumHistogramDigits uint8 `structs:"number_of_significant_value_digits,omitempty"`
} `structs:"hdr,omitempty"`
}
PercentilesAgg represents an aggregation of type "percentiles", as described in https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-percentile-aggregation.html
func Percentiles ¶
func Percentiles(name, field string) *PercentilesAgg
Percentiles creates a new aggregation of type "percentiles" with the provided name and on the provided field.
func (*PercentilesAgg) Compression ¶
func (agg *PercentilesAgg) Compression(val uint16) *PercentilesAgg
Compression sets the compression level for the aggregation.
func (*PercentilesAgg) Keyed ¶
func (agg *PercentilesAgg) Keyed(b bool) *PercentilesAgg
Keyed sets whether the aggregate is keyed or not.
func (*PercentilesAgg) Map ¶
func (agg *PercentilesAgg) Map() map[string]interface{}
Map returns a map representation of the aggregation, thus implementing the Mappable interface.
func (*PercentilesAgg) Missing ¶
func (agg *PercentilesAgg) Missing(val interface{}) *PercentilesAgg
Missing sets the value to provide for records that are missing a value for the field.
func (*PercentilesAgg) NumHistogramDigits ¶
func (agg *PercentilesAgg) NumHistogramDigits(val uint8) *PercentilesAgg
NumHistogramDigits specifies the resolution of values for the histogram in number of significant digits.
func (*PercentilesAgg) Percents ¶
func (agg *PercentilesAgg) Percents(percents ...float32) *PercentilesAgg
Percents sets the aggregation's percentages
type StatsAgg ¶
type StatsAgg struct {
*BaseAgg `structs:",flatten"`
}
StatsAgg represents an aggregation of type "stats", as described in: https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-stats-aggregation.html
type StringStatsAgg ¶
type StringStatsAgg struct {
*BaseAgg `structs:",flatten"`
// ShowDist indicates whether to ask ElasticSearch to return a probability
// distribution for all characters
ShowDist *bool `structs:"show_distribution,omitempty"`
}
StringStatsAgg represents an aggregation of type "string_stats", as described in https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-string-stats-aggregation.html
func StringStats ¶
func StringStats(name, field string) *StringStatsAgg
StringStats creates a new "string_stats" aggregation with the provided name and on the provided field.
func (*StringStatsAgg) Map ¶
func (agg *StringStatsAgg) Map() map[string]interface{}
Map returns a map representation of the aggregation, thus implementing the Mappable interface.
func (*StringStatsAgg) Missing ¶
func (agg *StringStatsAgg) Missing(val interface{}) *StringStatsAgg
Missing sets the value to provide for records missing a value for the field.
func (*StringStatsAgg) ShowDistribution ¶
func (agg *StringStatsAgg) ShowDistribution(b bool) *StringStatsAgg
ShowDistribution sets whether to show the probability distribution for all characters
type SumAgg ¶
type SumAgg struct {
*BaseAgg `structs:",flatten"`
}
SumAgg represents an aggregation of type "sum", as described in: https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-sum-aggregation.html
type TermsAggregation ¶
type TermsAggregation struct {
// contains filtered or unexported fields
}
TermsAggregation represents an aggregation of type "terms", as described in https://www.elastic.co/guide/en/elasticsearch/reference/current/
search-aggregations-bucket-terms-aggregation.html
func TermsAgg ¶
func TermsAgg(name, field string) *TermsAggregation
TermsAgg creates a new aggregation of type "terms". The method name includes the "Agg" suffix to prevent conflict with the "terms" query.
func (*TermsAggregation) Aggs ¶
func (agg *TermsAggregation) Aggs(aggs ...common.Aggregation) *TermsAggregation
Aggs sets sub-aggregations for the aggregation.
func (*TermsAggregation) Include ¶
func (agg *TermsAggregation) Include(include ...string) *TermsAggregation
Include filter the values for buckets
func (*TermsAggregation) Map ¶
func (agg *TermsAggregation) Map() map[string]interface{}
Map returns a map representation of the aggregation, thus implementing the Mappable interface.
func (*TermsAggregation) Name ¶
func (agg *TermsAggregation) Name() string
Name returns the name of the aggregation.
func (*TermsAggregation) Order ¶
func (agg *TermsAggregation) Order(order map[string]string) *TermsAggregation
Order sets the sort for terms agg
func (*TermsAggregation) ShardSize ¶
func (agg *TermsAggregation) ShardSize(size float64) *TermsAggregation
ShardSize sets how many terms to request from each shard.
func (*TermsAggregation) ShowTermDocCountError ¶
func (agg *TermsAggregation) ShowTermDocCountError(b bool) *TermsAggregation
ShowTermDocCountError sets whether to show an error value for each term returned by the aggregation which represents the worst case error in the document count.
func (*TermsAggregation) Size ¶
func (agg *TermsAggregation) Size(size uint64) *TermsAggregation
Size sets the number of term buckets to return.
type TopHitsAgg ¶
type TopHitsAgg struct {
// contains filtered or unexported fields
}
TopHitsAgg represents an aggregation of type "top_hits", as described in https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-top-hits-aggregation.html
func TopHits ¶
func TopHits(name string) *TopHitsAgg
TopHits creates an aggregation of type "top_hits".
func (*TopHitsAgg) From ¶
func (agg *TopHitsAgg) From(offset uint64) *TopHitsAgg
From sets an offset from the first result to return.
func (*TopHitsAgg) Map ¶
func (agg *TopHitsAgg) Map() map[string]interface{}
Map returns a map representation of the aggregation, thus implementing the Mappable interface.
func (*TopHitsAgg) Name ¶
func (agg *TopHitsAgg) Name() string
Name returns the name of the aggregation.
func (*TopHitsAgg) Size ¶
func (agg *TopHitsAgg) Size(size uint64) *TopHitsAgg
Size sets the maximum number of top matching hits to return per bucket (the default is 3).
func (*TopHitsAgg) Sort ¶
func (agg *TopHitsAgg) Sort(name string, order Order) *TopHitsAgg
Sort sets how the top matching hits should be sorted. By default the hits are sorted by the score of the main query.
func (*TopHitsAgg) SourceIncludes ¶
func (agg *TopHitsAgg) SourceIncludes(keys ...string) *TopHitsAgg
SourceIncludes sets the keys to return from the top matching documents.
type ValueCountAgg ¶
type ValueCountAgg struct {
*BaseAgg `structs:",flatten"`
}
ValueCountAgg represents an aggregation of type "value_count", as described in https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-valuecount-aggregation.html
func ValueCount ¶
func ValueCount(name, field string) *ValueCountAgg
ValueCount creates a new aggregation of type "value_count", with the provided name and on the provided field
type WeightedAvgAgg ¶
type WeightedAvgAgg struct {
// Val is the value component of the aggregation
Val *BaseAggParams `structs:"value"`
// Weig is the weight component of the aggregation
Weig *BaseAggParams `structs:"weight"`
// contains filtered or unexported fields
}
WeightedAvgAgg represents an aggregation of type "weighted_avg", as described in https://www.elastic.co/guide/en/elasticsearch/reference/
current/search-aggregations-metrics-weight-avg-aggregation.html
func WeightedAvg ¶
func WeightedAvg(name string) *WeightedAvgAgg
WeightedAvg creates a new aggregation of type "weighted_agg" with the provided name.
func (*WeightedAvgAgg) Map ¶
func (agg *WeightedAvgAgg) Map() map[string]interface{}
Map returns a map representation of the aggregation, thus implementing the Mappable interface.
func (*WeightedAvgAgg) Name ¶
func (agg *WeightedAvgAgg) Name() string
Name returns the name of the aggregation.
func (*WeightedAvgAgg) Value ¶
func (agg *WeightedAvgAgg) Value(field string, missing ...interface{}) *WeightedAvgAgg
Value sets the value field and optionally a value to use when records are missing a value for the field.
func (*WeightedAvgAgg) Weight ¶
func (agg *WeightedAvgAgg) Weight(field string, missing ...interface{}) *WeightedAvgAgg
Value sets the weight field and optionally a value to use when records are missing a value for the field.