delete

package
v8.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Overview

Removes a document from the index.

Index

Constants

This section is empty.

Variables

View Source
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 Delete

type Delete struct {
	// contains filtered or unexported fields
}

func (Delete) Do

func (r Delete) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a delete.Response

func (*Delete) Header

func (r *Delete) Header(key, value string) *Delete

Header set a key, value pair in the Delete headers map.

func (*Delete) HttpRequest

func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*Delete) IfPrimaryTerm

func (r *Delete) IfPrimaryTerm(ifprimaryterm string) *Delete

IfPrimaryTerm Only perform the operation if the document has this primary term. API name: if_primary_term

func (*Delete) IfSeqNo

func (r *Delete) IfSeqNo(sequencenumber string) *Delete

IfSeqNo Only perform the operation if the document has this sequence number. API name: if_seq_no

func (Delete) IsSuccess

func (r Delete) IsSuccess(providedCtx context.Context) (bool, error)

IsSuccess allows to run a query with a context and retrieve the result as a boolean. This only exists for endpoints without a request payload and allows for quick control flow.

func (Delete) Perform added in v8.7.0

func (r Delete) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*Delete) Refresh

func (r *Delete) Refresh(refresh refresh.Refresh) *Delete

Refresh If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. API name: refresh

func (*Delete) Routing

func (r *Delete) Routing(routing string) *Delete

Routing Custom value used to route operations to a specific shard. API name: routing

func (*Delete) Timeout

func (r *Delete) Timeout(duration string) *Delete

Timeout Period to wait for active shards. API name: timeout

func (*Delete) Version

func (r *Delete) Version(versionnumber string) *Delete

Version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. API name: version

func (*Delete) VersionType

func (r *Delete) VersionType(versiontype versiontype.VersionType) *Delete

VersionType Specific version type: `external`, `external_gte`. API name: version_type

func (*Delete) WaitForActiveShards

func (r *Delete) WaitForActiveShards(waitforactiveshards string) *Delete

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

type NewDelete

type NewDelete func(index, id string) *Delete

NewDelete type alias for index.

func NewDeleteFunc

func NewDeleteFunc(tp elastictransport.Interface) NewDelete

NewDeleteFunc returns a new instance of Delete with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type Response added in v8.7.0

type Response struct {
	ForcedRefresh *bool                 `json:"forced_refresh,omitempty"`
	Id_           string                `json:"_id"`
	Index_        string                `json:"_index"`
	PrimaryTerm_  int64                 `json:"_primary_term"`
	Result        result.Result         `json:"result"`
	SeqNo_        int64                 `json:"_seq_no"`
	Shards_       types.ShardStatistics `json:"_shards"`
	Version_      int64                 `json:"_version"`
}

Response holds the response body struct for the package delete

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/_global/delete/DeleteResponse.ts#L22-L34

func NewResponse added in v8.7.0

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL