Documentation ¶
Overview ¶
Removes a document from the index.
Index ¶
- Variables
- type Delete
- func (r Delete) Do(providedCtx context.Context) (*Response, error)
- func (r *Delete) Header(key, value string) *Delete
- func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Delete) IfPrimaryTerm(ifprimaryterm string) *Delete
- func (r *Delete) IfSeqNo(sequencenumber string) *Delete
- func (r Delete) IsSuccess(providedCtx context.Context) (bool, error)
- func (r Delete) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Delete) Refresh(refresh refresh.Refresh) *Delete
- func (r *Delete) Routing(routing string) *Delete
- func (r *Delete) Timeout(duration string) *Delete
- func (r *Delete) Version(versionnumber string) *Delete
- func (r *Delete) VersionType(versiontype versiontype.VersionType) *Delete
- func (r *Delete) WaitForActiveShards(waitforactiveshards string) *Delete
- type NewDelete
- 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 Delete ¶
type Delete struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Delete
Removes a document from the index.
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html
func (Delete) Do ¶
Do runs the request through the transport, handle the response and returns a delete.Response
func (*Delete) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Delete) IfPrimaryTerm ¶
IfPrimaryTerm Only perform the operation if the document has this primary term. API name: if_primary_term
func (*Delete) IfSeqNo ¶
IfSeqNo Only perform the operation if the document has this sequence number. API name: if_seq_no
func (Delete) IsSuccess ¶
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
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Delete) Refresh ¶
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 ¶
Routing Custom value used to route operations to a specific shard. API name: routing
func (*Delete) Version ¶
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 ¶
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 ¶
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