Skip to content

Commit

Permalink
Add some more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
olivere committed Mar 16, 2018
1 parent d4da960 commit 7f44f83
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 12 deletions.
4 changes: 3 additions & 1 deletion search_aggs_pipeline_avg_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package elastic
// be a multi-bucket aggregation.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-avg-bucket-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-avg-bucket-aggregation.html
type AvgBucketAggregation struct {
format string
gapPolicy string
Expand All @@ -26,6 +26,7 @@ func NewAvgBucketAggregation() *AvgBucketAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *AvgBucketAggregation) Format(format string) *AvgBucketAggregation {
a.format = format
return a
Expand Down Expand Up @@ -62,6 +63,7 @@ func (a *AvgBucketAggregation) BucketsPath(bucketsPaths ...string) *AvgBucketAgg
return a
}

// Source returns the a JSON-serializable interface.
func (a *AvgBucketAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_bucket_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package elastic
// numeric and the script must return a numeric value.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-bucket-script-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-bucket-script-aggregation.html
type BucketScriptAggregation struct {
format string
gapPolicy string
Expand All @@ -27,6 +27,7 @@ func NewBucketScriptAggregation() *BucketScriptAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *BucketScriptAggregation) Format(format string) *BucketScriptAggregation {
a.format = format
return a
Expand Down Expand Up @@ -78,6 +79,7 @@ func (a *BucketScriptAggregation) AddBucketsPath(name, path string) *BucketScrip
return a
}

// Source returns the a JSON-serializable interface.
func (a *BucketScriptAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_bucket_selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package elastic
// will be evaluated as false and all other values will evaluate to true.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-bucket-selector-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-bucket-selector-aggregation.html
type BucketSelectorAggregation struct {
format string
gapPolicy string
Expand All @@ -29,6 +29,7 @@ func NewBucketSelectorAggregation() *BucketSelectorAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *BucketSelectorAggregation) Format(format string) *BucketSelectorAggregation {
a.format = format
return a
Expand Down Expand Up @@ -80,6 +81,7 @@ func (a *BucketSelectorAggregation) AddBucketsPath(name, path string) *BucketSel
return a
}

// Source returns the a JSON-serializable interface.
func (a *BucketSelectorAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_cumulative_sum.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package elastic
// histogram must have min_doc_count set to 0 (default for histogram aggregations).
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-cumulative-sum-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-cumulative-sum-aggregation.html
type CumulativeSumAggregation struct {
format string

Expand All @@ -25,6 +25,7 @@ func NewCumulativeSumAggregation() *CumulativeSumAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *CumulativeSumAggregation) Format(format string) *CumulativeSumAggregation {
a.format = format
return a
Expand All @@ -42,6 +43,7 @@ func (a *CumulativeSumAggregation) BucketsPath(bucketsPaths ...string) *Cumulati
return a
}

// Source returns the a JSON-serializable interface.
func (a *CumulativeSumAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_derivative.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package elastic
// histogram must have min_doc_count set to 0 (default for histogram aggregations).
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-derivative-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-derivative-aggregation.html
type DerivativeAggregation struct {
format string
gapPolicy string
Expand All @@ -27,6 +27,7 @@ func NewDerivativeAggregation() *DerivativeAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *DerivativeAggregation) Format(format string) *DerivativeAggregation {
a.format = format
return a
Expand Down Expand Up @@ -70,6 +71,7 @@ func (a *DerivativeAggregation) BucketsPath(bucketsPaths ...string) *DerivativeA
return a
}

// Source returns the a JSON-serializable interface.
func (a *DerivativeAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_max_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package elastic
// be a multi-bucket aggregation.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-max-bucket-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-max-bucket-aggregation.html
type MaxBucketAggregation struct {
format string
gapPolicy string
Expand All @@ -27,6 +27,7 @@ func NewMaxBucketAggregation() *MaxBucketAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *MaxBucketAggregation) Format(format string) *MaxBucketAggregation {
a.format = format
return a
Expand Down Expand Up @@ -63,6 +64,7 @@ func (a *MaxBucketAggregation) BucketsPath(bucketsPaths ...string) *MaxBucketAgg
return a
}

// Source returns the a JSON-serializable interface.
func (a *MaxBucketAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_min_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package elastic
// be a multi-bucket aggregation.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-min-bucket-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-min-bucket-aggregation.html
type MinBucketAggregation struct {
format string
gapPolicy string
Expand All @@ -27,6 +27,7 @@ func NewMinBucketAggregation() *MinBucketAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *MinBucketAggregation) Format(format string) *MinBucketAggregation {
a.format = format
return a
Expand Down Expand Up @@ -63,6 +64,7 @@ func (a *MinBucketAggregation) BucketsPath(bucketsPaths ...string) *MinBucketAgg
return a
}

// Source returns the a JSON-serializable interface.
func (a *MinBucketAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_mov_avg.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package elastic
// across the data and emit the average value of that window.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-movavg-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-movavg-aggregation.html
type MovAvgAggregation struct {
format string
gapPolicy string
Expand All @@ -28,6 +28,7 @@ func NewMovAvgAggregation() *MovAvgAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *MovAvgAggregation) Format(format string) *MovAvgAggregation {
a.format = format
return a
Expand Down Expand Up @@ -95,6 +96,7 @@ func (a *MovAvgAggregation) BucketsPath(bucketsPaths ...string) *MovAvgAggregati
return a
}

// Source returns the a JSON-serializable interface.
func (a *MovAvgAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
3 changes: 2 additions & 1 deletion search_aggs_pipeline_percentiles_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package elastic
// be a multi-bucket aggregation.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-percentiles-bucket-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-percentiles-bucket-aggregation.html
type PercentilesBucketAggregation struct {
format string
gapPolicy string
Expand Down Expand Up @@ -68,6 +68,7 @@ func (p *PercentilesBucketAggregation) BucketsPath(bucketsPaths ...string) *Perc
return p
}

// Source returns the a JSON-serializable interface.
func (p *PercentilesBucketAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_serial_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package elastic
// subtracted from itself at different time lags or periods.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-serialdiff-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-serialdiff-aggregation.html
type SerialDiffAggregation struct {
format string
gapPolicy string
Expand All @@ -26,6 +26,7 @@ func NewSerialDiffAggregation() *SerialDiffAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *SerialDiffAggregation) Format(format string) *SerialDiffAggregation {
a.format = format
return a
Expand Down Expand Up @@ -70,6 +71,7 @@ func (a *SerialDiffAggregation) BucketsPath(bucketsPaths ...string) *SerialDiffA
return a
}

// Source returns the a JSON-serializable interface.
func (a *SerialDiffAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_stats_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package elastic
// be a multi-bucket aggregation.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-stats-bucket-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-stats-bucket-aggregation.html
type StatsBucketAggregation struct {
format string
gapPolicy string
Expand All @@ -26,6 +26,7 @@ func NewStatsBucketAggregation() *StatsBucketAggregation {
}
}

// Format to use on the output of this aggregation.
func (s *StatsBucketAggregation) Format(format string) *StatsBucketAggregation {
s.format = format
return s
Expand Down Expand Up @@ -62,6 +63,7 @@ func (s *StatsBucketAggregation) BucketsPath(bucketsPaths ...string) *StatsBucke
return s
}

// Source returns the a JSON-serializable interface.
func (s *StatsBucketAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down
4 changes: 3 additions & 1 deletion search_aggs_pipeline_sum_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package elastic
// be a multi-bucket aggregation.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-sum-bucket-aggregation.html
// https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-aggregations-pipeline-sum-bucket-aggregation.html
type SumBucketAggregation struct {
format string
gapPolicy string
Expand All @@ -26,6 +26,7 @@ func NewSumBucketAggregation() *SumBucketAggregation {
}
}

// Format to use on the output of this aggregation.
func (a *SumBucketAggregation) Format(format string) *SumBucketAggregation {
a.format = format
return a
Expand Down Expand Up @@ -62,6 +63,7 @@ func (a *SumBucketAggregation) BucketsPath(bucketsPaths ...string) *SumBucketAgg
return a
}

// Source returns the a JSON-serializable interface.
func (a *SumBucketAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
Expand Down

0 comments on commit 7f44f83

Please sign in to comment.