exists

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: 11 Imported by: 3

Documentation

Overview

Returns information about whether a document exists in an 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 Exists

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

func New

Returns information about whether a document exists in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html

func (Exists) Do

func (r Exists) Do(ctx context.Context) (bool, error)

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

func (*Exists) Header

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

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

func (*Exists) HttpRequest

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

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

func (Exists) IsSuccess

func (r Exists) 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 (Exists) Perform added in v8.7.0

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

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

func (*Exists) Preference

func (r *Exists) Preference(preference string) *Exists

Preference Specifies the node or shard the operation should be performed on. Random by default. API name: preference

func (*Exists) Realtime

func (r *Exists) Realtime(realtime bool) *Exists

Realtime If `true`, the request is real-time as opposed to near-real-time. API name: realtime

func (*Exists) Refresh

func (r *Exists) Refresh(refresh bool) *Exists

Refresh If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes. API name: refresh

func (*Exists) Routing

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

Routing Target the specified primary shard. API name: routing

func (*Exists) SourceExcludes_

func (r *Exists) SourceExcludes_(fields ...string) *Exists

SourceExcludes_ A comma-separated list of source fields to exclude in the response. API name: _source_excludes

func (*Exists) SourceIncludes_

func (r *Exists) SourceIncludes_(fields ...string) *Exists

SourceIncludes_ A comma-separated list of source fields to include in the response. API name: _source_includes

func (*Exists) Source_

func (r *Exists) Source_(sourceconfigparam string) *Exists

Source_ `true` or `false` to return the `_source` field or not, or a list of fields to return. API name: _source

func (*Exists) StoredFields

func (r *Exists) StoredFields(fields ...string) *Exists

StoredFields List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the `_source` parameter defaults to false. API name: stored_fields

func (*Exists) Version

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

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 (*Exists) VersionType

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

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

type NewExists

type NewExists func(index, id string) *Exists

NewExists type alias for index.

func NewExistsFunc

func NewExistsFunc(tp elastictransport.Interface) NewExists

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

Jump to

Keyboard shortcuts

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