Documentation ¶
Index ¶
- Constants
- func ApiClient(apiBaseUri, authBaseUri, key, secret string) (c *apiClient, err error)
- func CardinalityAggregate(index, doctype string, query map[string]interface{}, field string) (int64, error)
- func EsClient(aa []string) (*elasticsearch.Client, error)
- func Handlers(r chi.Router, log *zap.Logger, esc *elasticsearch.Client, api *apiClient) *handlers
- func RangeAggregate(index, doctype string, query map[string]interface{}, field string) (float64, float64, error)
- type Aggregations
- type Bucket
- type DateHistogramInterval
- type EsSearchAggrResult
- type EsSearchAggrResults
- type EsSearchAggrTerms
- type ModuleMeta
- type Result
Constants ¶
View Source
const ( DateHistogramIntervalYear = "year" DateHistogramIntervalMonth = "month" DateHistogramIntervalDay = "day" DateHistogramIntervalHour = "hour" DateHistogramIntervalMinute = "minute" DateHistogramIntervalSecond = "second" DateHistogramIntervalAuto = "auto" )
Variables ¶
This section is empty.
Functions ¶
func CardinalityAggregate ¶
func CardinalityAggregate(index, doctype string, query map[string]interface{}, field string) (int64, error)
CardinalityAggregate returns the unique count of a specific field in a specific index
Types ¶
type Aggregations ¶
type Aggregations struct{}
type Bucket ¶
type Bucket struct { Key interface{} `json:"key"` Count int `json:"doc_count"` }
Bucket contains how often a specific key was found in a term aggregation.
func DateHistogramAggregate ¶
func DateHistogramAggregate(query map[string]interface{}, field string, interval DateHistogramInterval, buckets int) ([]*Bucket, error)
DateHistogramAggregate fixme to utility
type DateHistogramInterval ¶
type DateHistogramInterval string
type EsSearchAggrResult ¶
type EsSearchAggrResult struct {
Buckets []Bucket `json:"buckets"`
}
EsSearchAggrResult contains the result of the TermAggregation.
type EsSearchAggrResults ¶
type EsSearchAggrResults map[string]EsSearchAggrResult
EsSearchAggrResults is a list of EsSearchAggrResult.
type EsSearchAggrTerms ¶
type EsSearchAggrTerms map[string]esSearchAggr
EsSearchAggrTerms is aggregations parameter for es search api.
type ModuleMeta ¶
Click to show internal directories.
Click to hide internal directories.