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) Conflicts(conflicts conflicts.Conflicts) *Reindex
- func (r *Reindex) Dest(dest *types.ReindexDestination) *Reindex
- func (r Reindex) Do(providedCtx 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) MaxDocs(maxdocs int64) *Reindex
- func (r Reindex) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Reindex) Raw(raw io.Reader) *Reindex
- func (r *Reindex) Refresh(refresh bool) *Reindex
- func (r *Reindex) Request(req *Request) *Reindex
- func (r *Reindex) RequestsPerSecond(requestspersecond string) *Reindex
- func (r *Reindex) RequireAlias(requirealias bool) *Reindex
- func (r *Reindex) Script(script types.Script) *Reindex
- func (r *Reindex) Scroll(duration string) *Reindex
- func (r *Reindex) Size(size int64) *Reindex
- func (r *Reindex) Slices(slices string) *Reindex
- func (r *Reindex) Source(source *types.ReindexSource) *Reindex
- func (r *Reindex) Timeout(duration string) *Reindex
- func (r *Reindex) WaitForActiveShards(waitforactiveshards string) *Reindex
- func (r *Reindex) WaitForCompletion(waitforcompletion 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/current/docs-reindex.html
func (*Reindex) Conflicts ¶ added in v8.9.0
Conflicts Set to proceed to continue reindexing even if there are conflicts. API name: conflicts
func (*Reindex) Dest ¶ added in v8.9.0
func (r *Reindex) Dest(dest *types.ReindexDestination) *Reindex
Dest The destination you are copying to. API name: dest
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) MaxDocs ¶ added in v8.9.0
MaxDocs The maximum number of documents to reindex. API name: max_docs
func (Reindex) Perform ¶ added in v8.7.0
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) Refresh ¶
Refresh If `true`, the request refreshes affected shards to make this operation visible to search. API name: refresh
func (*Reindex) RequestsPerSecond ¶
RequestsPerSecond The throttle for this request in sub-requests per second. Defaults to no throttle. API name: requests_per_second
func (*Reindex) RequireAlias ¶
RequireAlias If `true`, the destination must be an index alias. API name: require_alias
func (*Reindex) Script ¶ added in v8.9.0
Script The script to run to update the document source or metadata when reindexing. API name: script
func (*Reindex) Scroll ¶
Scroll Specifies how long a consistent view of the index should be maintained for scrolled search. API name: scroll
func (*Reindex) Slices ¶
Slices The number of slices this task should be divided into. Defaults to 1 slice, meaning the task isn’t sliced into subtasks. API name: slices
func (*Reindex) Source ¶ added in v8.9.0
func (r *Reindex) Source(source *types.ReindexSource) *Reindex
Source The source you are copying from. API name: source
func (*Reindex) Timeout ¶
Timeout Period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. API name: timeout
func (*Reindex) WaitForActiveShards ¶
WaitForActiveShards The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). API name: wait_for_active_shards
func (*Reindex) WaitForCompletion ¶
WaitForCompletion If `true`, the request blocks until the operation is complete. API name: wait_for_completion
type Request ¶
type Request struct { // Conflicts Set to proceed to continue reindexing even if there are conflicts. Conflicts *conflicts.Conflicts `json:"conflicts,omitempty"` // Dest The destination you are copying to. Dest types.ReindexDestination `json:"dest"` // MaxDocs The maximum number of documents to reindex. MaxDocs *int64 `json:"max_docs,omitempty"` // Script The script to run to update the document source or metadata when reindexing. Script types.Script `json:"script,omitempty"` Size *int64 `json:"size,omitempty"` // Source The source you are copying from. Source types.ReindexSource `json:"source"` }
Request holds the request body struct for the package reindex
func (*Request) FromJSON ¶ added in v8.5.0
FromJSON allows to load an arbitrary json into the request structure
func (*Request) UnmarshalJSON ¶ added in v8.12.1
type Response ¶ added in v8.7.0
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"` }
Response holds the response body struct for the package reindex