Documentation ¶
Overview ¶
Returns a document.
Index ¶
- Variables
- type Get
- func (r Get) Do(providedCtx context.Context) (*Response, error)
- func (r *Get) ForceSyntheticSource(forcesyntheticsource bool) *Get
- func (r *Get) Header(key, value string) *Get
- func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r Get) IsSuccess(providedCtx context.Context) (bool, error)
- func (r Get) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Get) Preference(preference string) *Get
- func (r *Get) Realtime(realtime bool) *Get
- func (r *Get) Refresh(refresh bool) *Get
- func (r *Get) Routing(routing string) *Get
- func (r *Get) SourceExcludes_(fields ...string) *Get
- func (r *Get) SourceIncludes_(fields ...string) *Get
- func (r *Get) Source_(sourceconfigparam string) *Get
- func (r *Get) StoredFields(fields ...string) *Get
- func (r *Get) Version(versionnumber string) *Get
- func (r *Get) VersionType(versiontype versiontype.VersionType) *Get
- type NewGet
- 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 Get ¶
type Get struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Get
Returns a document.
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html
func (Get) Do ¶
Do runs the request through the transport, handle the response and returns a get.Response
func (*Get) ForceSyntheticSource ¶ added in v8.13.1
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) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (Get) 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 (Get) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Get) Preference ¶
Preference Specifies the node or shard the operation should be performed on. Random by default. API name: preference
func (*Get) Realtime ¶
Realtime If `true`, the request is real-time as opposed to near-real-time. API name: realtime
func (*Get) Refresh ¶
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) SourceExcludes_ ¶
SourceExcludes_ A comma-separated list of source fields to exclude in the response. API name: _source_excludes
func (*Get) SourceIncludes_ ¶
SourceIncludes_ A comma-separated list of source fields to include in the response. API name: _source_includes
func (*Get) Source_ ¶
Source_ True or false to return the _source field or not, or a list of fields to return. API name: _source
func (*Get) StoredFields ¶
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 ¶
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 ¶
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