get

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: 14 Imported by: 8

Documentation

Overview

Returns a document.

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 Get

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

func (Get) Do

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

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

func (*Get) ForceSyntheticSource added in v8.13.1

func (r *Get) ForceSyntheticSource(forcesyntheticsource bool) *Get

ForceSyntheticSource Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index. API name: force_synthetic_source

func (*Get) Header

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

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

func (*Get) HttpRequest

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

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

func (Get) IsSuccess

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

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

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

func (*Get) Preference

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

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

func (*Get) Realtime

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

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

func (*Get) Refresh

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

Refresh If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. API name: refresh

func (*Get) Routing

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

Routing Target the specified primary shard. API name: routing

func (*Get) SourceExcludes_

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

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

func (*Get) SourceIncludes_

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

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

func (*Get) Source_

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

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

func (*Get) StoredFields

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

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 (*Get) Version

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

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

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

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

type NewGet

type NewGet func(index, id string) *Get

NewGet type alias for index.

func NewGetFunc

func NewGetFunc(tp elastictransport.Interface) NewGet

NewGetFunc returns a new instance of Get 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 {
	Fields       map[string]json.RawMessage `json:"fields,omitempty"`
	Found        bool                       `json:"found"`
	Id_          string                     `json:"_id"`
	Index_       string                     `json:"_index"`
	PrimaryTerm_ *int64                     `json:"_primary_term,omitempty"`
	Routing_     *string                    `json:"_routing,omitempty"`
	SeqNo_       *int64                     `json:"_seq_no,omitempty"`
	Source_      json.RawMessage            `json:"_source,omitempty"`
	Version_     *int64                     `json:"_version,omitempty"`
}

Response holds the response body struct for the package get

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/_global/get/GetResponse.ts#L23-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