Documentation ¶
Overview ¶
Updates certain properties of a datafeed.
Index ¶
- Variables
- type NewUpdateDatafeed
- type Request
- type Response
- type UpdateDatafeed
- func (r *UpdateDatafeed) Aggregations(aggregations map[string]types.Aggregations) *UpdateDatafeed
- func (r *UpdateDatafeed) AllowNoIndices(allownoindices bool) *UpdateDatafeed
- func (r *UpdateDatafeed) ChunkingConfig(chunkingconfig *types.ChunkingConfig) *UpdateDatafeed
- func (r *UpdateDatafeed) DatafeedId(datafeedid string) *UpdateDatafeed
- func (r *UpdateDatafeed) DelayedDataCheckConfig(delayeddatacheckconfig *types.DelayedDataCheckConfig) *UpdateDatafeed
- func (r UpdateDatafeed) Do(ctx context.Context) (*Response, error)
- func (r *UpdateDatafeed) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *UpdateDatafeed
- func (r *UpdateDatafeed) Frequency(duration types.Duration) *UpdateDatafeed
- func (r *UpdateDatafeed) Header(key, value string) *UpdateDatafeed
- func (r *UpdateDatafeed) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *UpdateDatafeed) IgnoreThrottled(ignorethrottled bool) *UpdateDatafeed
- func (r *UpdateDatafeed) IgnoreUnavailable(ignoreunavailable bool) *UpdateDatafeed
- func (r *UpdateDatafeed) Indices(indices ...string) *UpdateDatafeed
- func (r *UpdateDatafeed) IndicesOptions(indicesoptions *types.IndicesOptions) *UpdateDatafeed
- func (r *UpdateDatafeed) JobId(id string) *UpdateDatafeed
- func (r *UpdateDatafeed) MaxEmptySearches(maxemptysearches int) *UpdateDatafeed
- func (r UpdateDatafeed) Perform(ctx context.Context) (*http.Response, error)
- func (r *UpdateDatafeed) Query(query *types.Query) *UpdateDatafeed
- func (r *UpdateDatafeed) QueryDelay(duration types.Duration) *UpdateDatafeed
- func (r *UpdateDatafeed) Raw(raw io.Reader) *UpdateDatafeed
- func (r *UpdateDatafeed) Request(req *Request) *UpdateDatafeed
- func (r *UpdateDatafeed) RuntimeMappings(runtimefields types.RuntimeFields) *UpdateDatafeed
- func (r *UpdateDatafeed) ScriptFields(scriptfields map[string]types.ScriptField) *UpdateDatafeed
- func (r *UpdateDatafeed) ScrollSize(scrollsize int) *UpdateDatafeed
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 NewUpdateDatafeed ¶
type NewUpdateDatafeed func(datafeedid string) *UpdateDatafeed
NewUpdateDatafeed type alias for index.
func NewUpdateDatafeedFunc ¶
func NewUpdateDatafeedFunc(tp elastictransport.Interface) NewUpdateDatafeed
NewUpdateDatafeedFunc returns a new instance of UpdateDatafeed 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 If set, the datafeed performs aggregation searches. Support for aggregations // is limited and should be used only // with low cardinality data. Aggregations map[string]types.Aggregations `json:"aggregations,omitempty"` // ChunkingConfig Datafeeds might search over long time periods, for several months or years. // This search is split into time // chunks in order to ensure the load on Elasticsearch is managed. Chunking // configuration controls how the size of // these time chunks are calculated; it is an advanced configuration option. ChunkingConfig *types.ChunkingConfig `json:"chunking_config,omitempty"` // DelayedDataCheckConfig Specifies whether the datafeed checks for missing data and the size of the // window. The datafeed can optionally // search over indices that have already been read in an effort to determine // whether any data has subsequently been // added to the index. If missing data is found, it is a good indication that // the `query_delay` is set too low and // the data is being indexed after the datafeed has passed that moment in time. // This check runs only on real-time // datafeeds. DelayedDataCheckConfig *types.DelayedDataCheckConfig `json:"delayed_data_check_config,omitempty"` // Frequency The interval at which scheduled queries are made while the datafeed runs in // real time. The default value is // either the bucket span for short bucket spans, or, for longer bucket spans, a // sensible fraction of the bucket // span. When `frequency` is shorter than the bucket span, interim results for // the last (partial) bucket are // written then eventually overwritten by the full bucket results. If the // datafeed uses aggregations, this value // must be divisible by the interval of the date histogram aggregation. Frequency types.Duration `json:"frequency,omitempty"` // Indices An array of index names. Wildcards are supported. If any of the indices are // in remote clusters, the machine // learning nodes must have the `remote_cluster_client` role. Indices []string `json:"indices,omitempty"` // IndicesOptions Specifies index expansion options that are used during search. IndicesOptions *types.IndicesOptions `json:"indices_options,omitempty"` JobId *string `json:"job_id,omitempty"` // MaxEmptySearches If a real-time datafeed has never seen any data (including during any initial // training period), it automatically // stops and closes the associated job after this many real-time searches return // no documents. In other words, // it stops after `frequency` times `max_empty_searches` of real-time operation. // If not set, a datafeed with no // end time that sees no data remains started until it is explicitly stopped. By // default, it is not set. MaxEmptySearches *int `json:"max_empty_searches,omitempty"` // Query The Elasticsearch query domain-specific language (DSL). This value // corresponds to the query object in an // Elasticsearch search POST body. All the options that are supported by // Elasticsearch can be used, as this // object is passed verbatim to Elasticsearch. Note that if you change the // query, the analyzed data is also // changed. Therefore, the time required to learn might be long and the // understandability of the results is // unpredictable. If you want to make significant changes to the source data, it // is recommended that you // clone the job and datafeed and make the amendments in the clone. Let both run // in parallel and close one // when you are satisfied with the results of the job. Query *types.Query `json:"query,omitempty"` // QueryDelay The number of seconds behind real time that data is queried. For example, if // data from 10:04 a.m. might // not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 // seconds. The default // value is randomly selected between `60s` and `120s`. This randomness improves // the query performance // when there are multiple jobs running on the same node. QueryDelay types.Duration `json:"query_delay,omitempty"` // RuntimeMappings Specifies runtime fields for the datafeed search. RuntimeMappings types.RuntimeFields `json:"runtime_mappings,omitempty"` // ScriptFields Specifies scripts that evaluate custom expressions and returns script fields // to the datafeed. // The detector configuration objects in a job can contain functions that use // these script fields. ScriptFields map[string]types.ScriptField `json:"script_fields,omitempty"` // ScrollSize The size parameter that is used in Elasticsearch searches when the datafeed // does not use aggregations. // The maximum value is the value of `index.max_result_window`. ScrollSize *int `json:"scroll_size,omitempty"` }
Request holds the request body struct for the package updatedatafeed
type Response ¶ added in v8.7.0
type Response struct { Aggregations map[string]types.Aggregations `json:"aggregations,omitempty"` Authorization *types.DatafeedAuthorization `json:"authorization,omitempty"` ChunkingConfig types.ChunkingConfig `json:"chunking_config"` DatafeedId string `json:"datafeed_id"` DelayedDataCheckConfig *types.DelayedDataCheckConfig `json:"delayed_data_check_config,omitempty"` Frequency types.Duration `json:"frequency,omitempty"` Indices []string `json:"indices"` IndicesOptions *types.IndicesOptions `json:"indices_options,omitempty"` JobId string `json:"job_id"` MaxEmptySearches *int `json:"max_empty_searches,omitempty"` Query types.Query `json:"query"` QueryDelay types.Duration `json:"query_delay"` RuntimeMappings types.RuntimeFields `json:"runtime_mappings,omitempty"` ScriptFields map[string]types.ScriptField `json:"script_fields,omitempty"` ScrollSize int `json:"scroll_size"` }
type UpdateDatafeed ¶
type UpdateDatafeed struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *UpdateDatafeed
Updates certain properties of a datafeed.
https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html
func (*UpdateDatafeed) Aggregations ¶ added in v8.9.0
func (r *UpdateDatafeed) Aggregations(aggregations map[string]types.Aggregations) *UpdateDatafeed
Aggregations If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. API name: aggregations
func (*UpdateDatafeed) AllowNoIndices ¶
func (r *UpdateDatafeed) AllowNoIndices(allownoindices bool) *UpdateDatafeed
AllowNoIndices If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the `_all` string or when no indices are specified. API name: allow_no_indices
func (*UpdateDatafeed) ChunkingConfig ¶ added in v8.9.0
func (r *UpdateDatafeed) ChunkingConfig(chunkingconfig *types.ChunkingConfig) *UpdateDatafeed
ChunkingConfig Datafeeds might search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated; it is an advanced configuration option. API name: chunking_config
func (*UpdateDatafeed) DatafeedId ¶
func (r *UpdateDatafeed) DatafeedId(datafeedid string) *UpdateDatafeed
DatafeedId A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. API Name: datafeedid
func (*UpdateDatafeed) DelayedDataCheckConfig ¶ added in v8.9.0
func (r *UpdateDatafeed) DelayedDataCheckConfig(delayeddatacheckconfig *types.DelayedDataCheckConfig) *UpdateDatafeed
DelayedDataCheckConfig Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds. API name: delayed_data_check_config
func (UpdateDatafeed) Do ¶
func (r UpdateDatafeed) Do(ctx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a updatedatafeed.Response
func (*UpdateDatafeed) ExpandWildcards ¶
func (r *UpdateDatafeed) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *UpdateDatafeed
ExpandWildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values. Valid values are:
* `all`: Match any data stream or index, including hidden ones. * `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. * `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or both. * `none`: Wildcard patterns are not accepted. * `open`: Match open, non-hidden indices. Also matches any non-hidden data stream. API name: expand_wildcards
func (*UpdateDatafeed) Frequency ¶ added in v8.9.0
func (r *UpdateDatafeed) Frequency(duration types.Duration) *UpdateDatafeed
Frequency The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation. API name: frequency
func (*UpdateDatafeed) Header ¶
func (r *UpdateDatafeed) Header(key, value string) *UpdateDatafeed
Header set a key, value pair in the UpdateDatafeed headers map.
func (*UpdateDatafeed) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*UpdateDatafeed) IgnoreThrottled ¶
func (r *UpdateDatafeed) IgnoreThrottled(ignorethrottled bool) *UpdateDatafeed
IgnoreThrottled If `true`, concrete, expanded or aliased indices are ignored when frozen. API name: ignore_throttled
func (*UpdateDatafeed) IgnoreUnavailable ¶
func (r *UpdateDatafeed) IgnoreUnavailable(ignoreunavailable bool) *UpdateDatafeed
IgnoreUnavailable If `true`, unavailable indices (missing or closed) are ignored. API name: ignore_unavailable
func (*UpdateDatafeed) Indices ¶ added in v8.9.0
func (r *UpdateDatafeed) Indices(indices ...string) *UpdateDatafeed
Indices An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role. API name: indices
func (*UpdateDatafeed) IndicesOptions ¶ added in v8.9.0
func (r *UpdateDatafeed) IndicesOptions(indicesoptions *types.IndicesOptions) *UpdateDatafeed
IndicesOptions Specifies index expansion options that are used during search. API name: indices_options
func (*UpdateDatafeed) JobId ¶ added in v8.9.0
func (r *UpdateDatafeed) JobId(id string) *UpdateDatafeed
API name: job_id
func (*UpdateDatafeed) MaxEmptySearches ¶ added in v8.9.0
func (r *UpdateDatafeed) MaxEmptySearches(maxemptysearches int) *UpdateDatafeed
MaxEmptySearches If a real-time datafeed has never seen any data (including during any initial training period), it automatically stops and closes the associated job after this many real-time searches return no documents. In other words, it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no end time that sees no data remains started until it is explicitly stopped. By default, it is not set. API name: max_empty_searches
func (UpdateDatafeed) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*UpdateDatafeed) Query ¶ added in v8.9.0
func (r *UpdateDatafeed) Query(query *types.Query) *UpdateDatafeed
Query The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also changed. Therefore, the time required to learn might be long and the understandability of the results is unpredictable. If you want to make significant changes to the source data, it is recommended that you clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one when you are satisfied with the results of the job. API name: query
func (*UpdateDatafeed) QueryDelay ¶ added in v8.9.0
func (r *UpdateDatafeed) QueryDelay(duration types.Duration) *UpdateDatafeed
QueryDelay The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node. API name: query_delay
func (*UpdateDatafeed) Raw ¶
func (r *UpdateDatafeed) Raw(raw io.Reader) *UpdateDatafeed
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*UpdateDatafeed) Request ¶
func (r *UpdateDatafeed) Request(req *Request) *UpdateDatafeed
Request allows to set the request property with the appropriate payload.
func (*UpdateDatafeed) RuntimeMappings ¶ added in v8.9.0
func (r *UpdateDatafeed) RuntimeMappings(runtimefields types.RuntimeFields) *UpdateDatafeed
RuntimeMappings Specifies runtime fields for the datafeed search. API name: runtime_mappings
func (*UpdateDatafeed) ScriptFields ¶ added in v8.9.0
func (r *UpdateDatafeed) ScriptFields(scriptfields map[string]types.ScriptField) *UpdateDatafeed
ScriptFields Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields. API name: script_fields
func (*UpdateDatafeed) ScrollSize ¶ added in v8.9.0
func (r *UpdateDatafeed) ScrollSize(scrollsize int) *UpdateDatafeed
ScrollSize The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`. API name: scroll_size