Documentation ¶
Index ¶
- Constants
- type Agg
- type AggResponseNestedWIP
- type AggResponseSimple
- type Aggregation
- type AggregationResRad
- type AggsBody
- type All
- type BoolQuery
- type Bucket
- type CreateIndexBody
- type DateHistogram
- type Filter
- type Filtered
- type FilteredOr
- type Hits
- type Index
- type Mapping
- type MatchQuery
- type Nested
- type Property
- type Query
- type QueryBody
- type Range
- type ResponseBody
- type Settings
- type Term
Constants ¶
const ( IndexNotAnalyzed = "not_analyzed" TypeString = "string" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agg ¶
type Agg struct { Filter *Filter `json:"filter,omitempty"` Nested *Nested `json:"nested,omitempty"` Terms *Term `json:"terms,omitempty"` Aggs map[string]Agg `json:"aggs,omitempty"` DateHistogram *DateHistogram `json:"date_histogram,omitempty"` }
Agg represents one aggregation. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html DateHistogram: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html#search-aggregations-bucket-datehistogram-aggregation
type AggResponseNestedWIP ¶
type AggResponseNestedWIP struct {
Aggregations map[string]map[string]interface{} `json:"aggregations,omitempty"`
}
AggResponseWIP is working response object used to format an aggregations response using Elastirad's AggResponseRad struct.
type AggResponseSimple ¶
type AggResponseSimple struct {
Aggregations map[string]Aggregation `json:"aggregations,omitempty"`
}
type Aggregation ¶
type Aggregation struct { DocCountErrorUpperBound int `json:"doc_count_error_upper_bound,omitempty"` SumOtherDocCount int `json:"sum_other_doc_count,omitempty"` Buckets []Bucket `json:"buckets,omitempty"` }
Aggregation is a Elasticsearch aggregation response struct.
type AggregationResRad ¶
type AggregationResRad struct { AggregationName string `json:"aggregation_name,omitempty"` Type string `json:"type,omitempty"` DocCount int `json:"doc_count,omitempty"` AggregationData Aggregation `json:"aggregation_data,omitempty"` }
AggregationResRad is a Go optimized response struct.
func AggregationResRadArrayFromBodyBytes ¶
func AggregationResRadArrayFromBodyBytes(bytes []byte) ([]AggregationResRad, error)
AggregationResRadArrayFromBodyBytes is used to parse simple, non-nested aggregations.
func AggregationResRadArrayFromBodyBytesNested ¶
func AggregationResRadArrayFromBodyBytesNested(bytes []byte) ([]AggregationResRad, error)
AggregationResRadArrayFromBodyBytesNested returns an array of formatted Aggregations using AggregationResRad structs given a HTTP response byte array. Nested
type AggsBody ¶
type AggsBody struct { Size int `json:"size"` Query *Query `json:"query,omitempty"` Aggs map[string]Agg `json:"aggs,omitempty"` }
AggsBody represents the body of an aggregation API request.
type BoolQuery ¶
type BoolQuery struct { Must []Filter `json:"must,omitempty"` Should []Filter `json:"should,omitempty"` MinimumShouldMatch int `json:"minimum_should_match,omitempty"` Boost float64 `json:"boost,omitempty"` }
BoolQuery represents a Query API bool object.
type Bucket ¶
type Bucket struct { Key interface{} `json:"key,omitempty"` KeyAsString string `json:"key_as_string,omitempty"` DocCount int `json:"doc_count,omitempty"` }
Bucket is an Elasticsearch aggregation response bucket struct.
type CreateIndexBody ¶
type DateHistogram ¶
type DateHistogram struct { Field string `json:"field,omitempty"` Interval string `json:"interval,omitempty"` }
DateHistogram represents the Elasticsearch date_histogram aggregation.
type Filter ¶
type Filter struct { Match map[string]string `json:"match,omitempty"` Term map[string]string `json:"term,omitempty"` Range map[string]Range `json:"range,omitempty"` }
Filter represents a Query API filter object.
type Filtered ¶
type Filtered struct {
Or FilteredOr `json:"or,omitempty"`
}
Filtered represents a Query API filtered object.
type FilteredOr ¶
type FilteredOr struct { Filters []Filter `json:"filters,omitempty"` Cache bool `json:"_cache,omitempty"` }
FilteredOr represents a Query API filtered or object.
type MatchQuery ¶
type MatchQuery struct { Query string `json:"query,omitempty"` Operator string `json:"operator,omitempty"` ZeroTermsQuery string `json:"zero_terms_query,omitempty"` }
MatchQuery represents a Query API match object.
type Nested ¶
type Nested struct { Path string `json:"path,omitempty"` ScoreMode string `json:"score_mode,omitempty"` Query *Query `json:"query,omitempty"` }
Nested indicates whether the aggregation key is a nested key or not. It is mandatory to use a nested key (e.g. a key using dot notation).
type Query ¶
type Query struct { Bool *BoolQuery `json:"bool,omitempty"` Nested *Nested `json:"nested,omitempty"` Match map[string]MatchQuery `json:"match,omitempty"` Range map[string]Range `json:"range,omitempty"` }
Query represents a Query API query object.
type QueryBody ¶
type QueryBody struct {
Query Query `json:"query,omitempty"`
}
QueryBody represents a HTTP request body for the Elasticsearch query API.
type Range ¶
type Range struct { GT interface{} `json:"gt,omitempty"` GTE interface{} `json:"gte,omitempty"` LT interface{} `json:"lt,omitempty"` LTE interface{} `json:"lte,omitempty"` Boost float32 `json:"boost,omitempty"` }
type ResponseBody ¶
type ResponseBody struct {
Hits Hits `json:"hits,omitempty"`
}