Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { Key string `json:"key,omitempty"` KeyAsString string `json:"key-as-string,omitempty"` Aggs map[string]*ItemAgg `json:"aggs,omitempty"` Buckets map[string][]*Item `json:"buckets,omitempty"` Baselines map[string]baseline.BaselineValue `json:"baselines,omitempty"` }
Item is used to represent a calculated aggregate and it's sub-aggregate
func EnrichWithTotalHits ¶
EnrichWithTotalHits enrich an Item with a new key doc_count giving the total number of hits
func ParseAggs ¶
ParseAggs parse the Aggregations part of an elasticsearch result It is used recursively to parse sub aggs
func (*Item) ToAbstractMap ¶
ToAbstractMap convert an Item in an abstract map[string]interface{}
type ItemAgg ¶
type ItemAgg struct {
Value interface{} `json:"value,omitempty"`
}
ItemAgg is used to represent a single aggregate value
type WidgetData ¶
WidgetData is a standard api response format for fact
func Parse ¶
func Parse(res *elastic.SearchResult) (*WidgetData, error)
Parse parse a elasticsearch SearchResult (hits and aggregations) and returns a WidgetData
Click to show internal directories.
Click to hide internal directories.