Documentation
¶
Overview ¶
Preview a transform. Generates a preview of the results that you will get when you create a transform with the same configuration.
It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations.
Index ¶
- Variables
- type NewPreviewTransform
- type PreviewTransform
- func (r *PreviewTransform) Description(description string) *PreviewTransform
- func (r *PreviewTransform) Dest(dest types.TransformDestinationVariant) *PreviewTransform
- func (r PreviewTransform) Do(providedCtx context.Context) (*Response, error)
- func (r *PreviewTransform) ErrorTrace(errortrace bool) *PreviewTransform
- func (r *PreviewTransform) FilterPath(filterpaths ...string) *PreviewTransform
- func (r *PreviewTransform) Frequency(duration types.DurationVariant) *PreviewTransform
- func (r *PreviewTransform) Header(key, value string) *PreviewTransform
- func (r *PreviewTransform) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PreviewTransform) Human(human bool) *PreviewTransform
- func (r *PreviewTransform) Latest(latest types.LatestVariant) *PreviewTransform
- func (r PreviewTransform) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PreviewTransform) Pivot(pivot types.PivotVariant) *PreviewTransform
- func (r *PreviewTransform) Pretty(pretty bool) *PreviewTransform
- func (r *PreviewTransform) Raw(raw io.Reader) *PreviewTransform
- func (r *PreviewTransform) Request(req *Request) *PreviewTransform
- func (r *PreviewTransform) RetentionPolicy(retentionpolicy types.RetentionPolicyContainerVariant) *PreviewTransform
- func (r *PreviewTransform) Settings(settings types.SettingsVariant) *PreviewTransform
- func (r *PreviewTransform) Source(source types.TransformSourceVariant) *PreviewTransform
- func (r *PreviewTransform) Sync(sync types.SyncContainerVariant) *PreviewTransform
- func (r *PreviewTransform) Timeout(duration string) *PreviewTransform
- func (r *PreviewTransform) TransformId(transformid string) *PreviewTransform
- type Request
- type Response
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 NewPreviewTransform ¶
type NewPreviewTransform func() *PreviewTransform
NewPreviewTransform type alias for index.
func NewPreviewTransformFunc ¶
func NewPreviewTransformFunc(tp elastictransport.Interface) NewPreviewTransform
NewPreviewTransformFunc returns a new instance of PreviewTransform with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PreviewTransform ¶
type PreviewTransform struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PreviewTransform
Preview a transform. Generates a preview of the results that you will get when you create a transform with the same configuration.
It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations.
https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-preview-transform
func (*PreviewTransform) Description ¶
func (r *PreviewTransform) Description(description string) *PreviewTransform
Free text description of the transform. API name: description
func (*PreviewTransform) Dest ¶
func (r *PreviewTransform) Dest(dest types.TransformDestinationVariant) *PreviewTransform
The destination for the transform. API name: dest
func (PreviewTransform) Do ¶
func (r PreviewTransform) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a previewtransform.Response
func (*PreviewTransform) ErrorTrace ¶
func (r *PreviewTransform) ErrorTrace(errortrace bool) *PreviewTransform
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*PreviewTransform) FilterPath ¶
func (r *PreviewTransform) FilterPath(filterpaths ...string) *PreviewTransform
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*PreviewTransform) Frequency ¶
func (r *PreviewTransform) Frequency(duration types.DurationVariant) *PreviewTransform
The interval between checks for changes in the source indices when the transform is running continuously. Also determines the retry interval in the event of transient failures while the transform is searching or indexing. The minimum value is 1s and the maximum is 1h. API name: frequency
func (*PreviewTransform) Header ¶
func (r *PreviewTransform) Header(key, value string) *PreviewTransform
Header set a key, value pair in the PreviewTransform headers map.
func (*PreviewTransform) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PreviewTransform) Human ¶
func (r *PreviewTransform) Human(human bool) *PreviewTransform
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (*PreviewTransform) Latest ¶
func (r *PreviewTransform) Latest(latest types.LatestVariant) *PreviewTransform
The latest method transforms the data by finding the latest document for each unique key. API name: latest
func (PreviewTransform) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PreviewTransform) Pivot ¶
func (r *PreviewTransform) Pivot(pivot types.PivotVariant) *PreviewTransform
The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields and the aggregation to reduce the data. API name: pivot
func (*PreviewTransform) Pretty ¶
func (r *PreviewTransform) Pretty(pretty bool) *PreviewTransform
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*PreviewTransform) Raw ¶
func (r *PreviewTransform) Raw(raw io.Reader) *PreviewTransform
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*PreviewTransform) Request ¶
func (r *PreviewTransform) Request(req *Request) *PreviewTransform
Request allows to set the request property with the appropriate payload.
func (*PreviewTransform) RetentionPolicy ¶
func (r *PreviewTransform) RetentionPolicy(retentionpolicy types.RetentionPolicyContainerVariant) *PreviewTransform
Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the destination index. API name: retention_policy
func (*PreviewTransform) Settings ¶
func (r *PreviewTransform) Settings(settings types.SettingsVariant) *PreviewTransform
Defines optional transform settings. API name: settings
func (*PreviewTransform) Source ¶
func (r *PreviewTransform) Source(source types.TransformSourceVariant) *PreviewTransform
The source of the data for the transform. API name: source
func (*PreviewTransform) Sync ¶
func (r *PreviewTransform) Sync(sync types.SyncContainerVariant) *PreviewTransform
Defines the properties transforms require to run continuously. API name: sync
func (*PreviewTransform) Timeout ¶
func (r *PreviewTransform) Timeout(duration string) *PreviewTransform
Timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. API name: timeout
func (*PreviewTransform) TransformId ¶
func (r *PreviewTransform) TransformId(transformid string) *PreviewTransform
TransformId Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in the request body. API Name: transformid
type Request ¶
type Request struct { // Description Free text description of the transform. Description *string `json:"description,omitempty"` // Dest The destination for the transform. Dest *types.TransformDestination `json:"dest,omitempty"` // Frequency The interval between checks for changes in the source indices when the // transform is running continuously. Also determines the retry interval in // the event of transient failures while the transform is searching or // indexing. The minimum value is 1s and the maximum is 1h. Frequency types.Duration `json:"frequency,omitempty"` // Latest The latest method transforms the data by finding the latest document for // each unique key. Latest *types.Latest `json:"latest,omitempty"` // Pivot The pivot method transforms the data by aggregating and grouping it. // These objects define the group by fields and the aggregation to reduce // the data. Pivot *types.Pivot `json:"pivot,omitempty"` // RetentionPolicy Defines a retention policy for the transform. Data that meets the defined // criteria is deleted from the destination index. RetentionPolicy *types.RetentionPolicyContainer `json:"retention_policy,omitempty"` // Settings Defines optional transform settings. Settings *types.Settings `json:"settings,omitempty"` // Source The source of the data for the transform. Source *types.TransformSource `json:"source,omitempty"` // Sync Defines the properties transforms require to run continuously. Sync *types.SyncContainer `json:"sync,omitempty"` }
Request holds the request body struct for the package previewtransform
func (*Request) UnmarshalJSON ¶
type Response ¶
type Response struct { GeneratedDestIndex types.IndexState `json:"generated_dest_index"` Preview []json.RawMessage `json:"preview"` }
Response holds the response body struct for the package previewtransform