Documentation ¶
Overview ¶
Enables searching rolled-up data using the standard query DSL.
Index ¶
- Variables
- type NewRollupSearch
- type Request
- type Response
- type RollupSearch
- func (r RollupSearch) Do(ctx context.Context) (*Response, error)
- func (r *RollupSearch) Header(key, value string) *RollupSearch
- func (r *RollupSearch) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *RollupSearch) Index(v string) *RollupSearch
- func (r RollupSearch) Perform(ctx context.Context) (*http.Response, error)
- func (r *RollupSearch) Raw(raw io.Reader) *RollupSearch
- func (r *RollupSearch) Request(req *Request) *RollupSearch
- func (r *RollupSearch) RestTotalHitsAsInt(b bool) *RollupSearch
- func (r *RollupSearch) TypedKeys(b bool) *RollupSearch
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewRollupSearch ¶
type NewRollupSearch func(index string) *RollupSearch
NewRollupSearch type alias for index.
func NewRollupSearchFunc ¶
func NewRollupSearchFunc(tp elastictransport.Interface) NewRollupSearch
NewRollupSearchFunc returns a new instance of RollupSearch with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request struct { Aggregations map[string]types.Aggregations `json:"aggregations,omitempty"` Query *types.Query `json:"query,omitempty"` // Size Must be zero if set, as rollups work on pre-aggregated data Size *int `json:"size,omitempty"` }
Request holds the request body struct for the package rollupsearch
type Response ¶ added in v8.7.0
type Response struct { Aggregations map[string]types.Aggregate `json:"aggregations,omitempty"` Hits types.HitsMetadata `json:"hits"` Shards_ types.ShardStatistics `json:"_shards"` TerminatedEarly *bool `json:"terminated_early,omitempty"` TimedOut bool `json:"timed_out"` Took int64 `json:"took"` }
func (*Response) UnmarshalJSON ¶ added in v8.7.0
type RollupSearch ¶
type RollupSearch struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *RollupSearch
Enables searching rolled-up data using the standard query DSL.
https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html
func (RollupSearch) Do ¶
func (r RollupSearch) Do(ctx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a rollupsearch.Response
func (*RollupSearch) Header ¶
func (r *RollupSearch) Header(key, value string) *RollupSearch
Header set a key, value pair in the RollupSearch headers map.
func (*RollupSearch) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*RollupSearch) Index ¶
func (r *RollupSearch) Index(v string) *RollupSearch
Index The indices or index-pattern(s) (containing rollup or regular data) that should be searched API Name: index
func (RollupSearch) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*RollupSearch) Raw ¶
func (r *RollupSearch) Raw(raw io.Reader) *RollupSearch
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*RollupSearch) Request ¶
func (r *RollupSearch) Request(req *Request) *RollupSearch
Request allows to set the request property with the appropriate payload.
func (*RollupSearch) RestTotalHitsAsInt ¶
func (r *RollupSearch) RestTotalHitsAsInt(b bool) *RollupSearch
RestTotalHitsAsInt Indicates whether hits.total should be rendered as an integer or an object in the rest search response API name: rest_total_hits_as_int
func (*RollupSearch) TypedKeys ¶
func (r *RollupSearch) TypedKeys(b bool) *RollupSearch
TypedKeys Specify whether aggregation and suggester names should be prefixed by their respective types in the response API name: typed_keys