Documentation
¶
Overview ¶
Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.
Index ¶
- Variables
- type NewReindex
- type Reindex
- func (r Reindex) Do(ctx context.Context) (*Response, error)
- func (r *Reindex) Header(key, value string) *Reindex
- func (r *Reindex) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r Reindex) Perform(ctx context.Context) (*http.Response, error)
- func (r *Reindex) Raw(raw io.Reader) *Reindex
- func (r *Reindex) Refresh(b bool) *Reindex
- func (r *Reindex) Request(req *Request) *Reindex
- func (r *Reindex) RequestsPerSecond(v string) *Reindex
- func (r *Reindex) RequireAlias(b bool) *Reindex
- func (r *Reindex) Scroll(v string) *Reindex
- func (r *Reindex) Slices(v string) *Reindex
- func (r *Reindex) Timeout(v string) *Reindex
- func (r *Reindex) WaitForActiveShards(v string) *Reindex
- func (r *Reindex) WaitForCompletion(b bool) *Reindex
- 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 NewReindex ¶
type NewReindex func() *Reindex
NewReindex type alias for index.
func NewReindexFunc ¶
func NewReindexFunc(tp elastictransport.Interface) NewReindex
NewReindexFunc returns a new instance of Reindex with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Reindex ¶
type Reindex struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Reindex
Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.
https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html
func (Reindex) Do ¶
Do runs the request through the transport, handle the response and returns a reindex.Response
func (*Reindex) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (Reindex) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Reindex) Raw ¶
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*Reindex) RequestsPerSecond ¶
RequestsPerSecond The throttle to set on this request in sub-requests per second. -1 means no throttle. API name: requests_per_second
func (*Reindex) RequireAlias ¶
API name: require_alias
func (*Reindex) Slices ¶
Slices The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. API name: slices
func (*Reindex) Timeout ¶
Timeout Time each individual bulk request should wait for shards that are unavailable. API name: timeout
func (*Reindex) WaitForActiveShards ¶
WaitForActiveShards Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) API name: wait_for_active_shards
func (*Reindex) WaitForCompletion ¶
WaitForCompletion Should the request should block until the reindex is complete. API name: wait_for_completion
type Request ¶
type Request struct { Conflicts *conflicts.Conflicts `json:"conflicts,omitempty"` Dest types.ReindexDestination `json:"dest"` MaxDocs *int64 `json:"max_docs,omitempty"` Script types.Script `json:"script,omitempty"` Size *int64 `json:"size,omitempty"` Source types.ReindexSource `json:"source"` }
Request holds the request body struct for the package reindex
type Response ¶
type Response struct { Batches *int64 `json:"batches,omitempty"` Created *int64 `json:"created,omitempty"` Deleted *int64 `json:"deleted,omitempty"` Failures []types.BulkIndexByScrollFailure `json:"failures,omitempty"` Noops *int64 `json:"noops,omitempty"` RequestsPerSecond *float32 `json:"requests_per_second,omitempty"` Retries *types.Retries `json:"retries,omitempty"` SliceId *int `json:"slice_id,omitempty"` Task types.TaskId `json:"task,omitempty"` ThrottledMillis *int64 `json:"throttled_millis,omitempty"` ThrottledUntilMillis *int64 `json:"throttled_until_millis,omitempty"` TimedOut *bool `json:"timed_out,omitempty"` Took *int64 `json:"took,omitempty"` Total *int64 `json:"total,omitempty"` Updated *int64 `json:"updated,omitempty"` VersionConflicts *int64 `json:"version_conflicts,omitempty"` }