Documentation ¶
Overview ¶
Allows to get multiple documents in one request.
Index ¶
- Variables
- type Mget
- func (r Mget) Do(providedCtx context.Context) (*Response, error)
- func (r *Mget) Docs(docs ...types.MgetOperation) *Mget
- func (r *Mget) ForceSyntheticSource(forcesyntheticsource bool) *Mget
- func (r *Mget) Header(key, value string) *Mget
- func (r *Mget) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Mget) Ids(ids ...string) *Mget
- func (r *Mget) Index(index string) *Mget
- func (r Mget) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Mget) Preference(preference string) *Mget
- func (r *Mget) Raw(raw io.Reader) *Mget
- func (r *Mget) Realtime(realtime bool) *Mget
- func (r *Mget) Refresh(refresh bool) *Mget
- func (r *Mget) Request(req *Request) *Mget
- func (r *Mget) Routing(routing string) *Mget
- func (r *Mget) SourceExcludes_(fields ...string) *Mget
- func (r *Mget) SourceIncludes_(fields ...string) *Mget
- func (r *Mget) Source_(sourceconfigparam string) *Mget
- func (r *Mget) StoredFields(fields ...string) *Mget
- type NewMget
- type Request
- 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 Mget ¶
type Mget struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Mget
Allows to get multiple documents in one request.
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html
func (Mget) Do ¶
Do runs the request through the transport, handle the response and returns a mget.Response
func (*Mget) Docs ¶ added in v8.9.0
func (r *Mget) Docs(docs ...types.MgetOperation) *Mget
Docs The documents you want to retrieve. Required if no index is specified in the request URI. API name: docs
func (*Mget) 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 (*Mget) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Mget) Ids ¶ added in v8.9.0
Ids The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI. API name: ids
func (*Mget) Index ¶
Index Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. API Name: index
func (Mget) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Mget) Preference ¶
Preference Specifies the node or shard the operation should be performed on. Random by default. API name: preference
func (*Mget) Raw ¶
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*Mget) Realtime ¶
Realtime If `true`, the request is real-time as opposed to near-real-time. API name: realtime
func (*Mget) Refresh ¶
Refresh If `true`, the request refreshes relevant shards before retrieving documents. API name: refresh
func (*Mget) Routing ¶
Routing Custom value used to route operations to a specific shard. API name: routing
func (*Mget) SourceExcludes_ ¶
SourceExcludes_ A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. API name: _source_excludes
func (*Mget) SourceIncludes_ ¶
SourceIncludes_ A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. API name: _source_includes
func (*Mget) Source_ ¶
Source_ True or false to return the `_source` field or not, or a list of fields to return. API name: _source
func (*Mget) StoredFields ¶
StoredFields If `true`, retrieves the document fields stored in the index rather than the document `_source`. API name: stored_fields
type NewMget ¶
type NewMget func() *Mget
NewMget type alias for index.
func NewMgetFunc ¶
func NewMgetFunc(tp elastictransport.Interface) NewMget
NewMgetFunc returns a new instance of Mget with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request struct { // Docs The documents you want to retrieve. Required if no index is specified in the // request URI. Docs []types.MgetOperation `json:"docs,omitempty"` // Ids The IDs of the documents you want to retrieve. Allowed when the index is // specified in the request URI. Ids []string `json:"ids,omitempty"` }
Request holds the request body struct for the package mget
func (*Request) FromJSON ¶ added in v8.5.0
FromJSON allows to load an arbitrary json into the request structure
func (*Request) UnmarshalJSON ¶ added in v8.12.1
type Response ¶ added in v8.7.0
type Response struct {
Docs []types.MgetResponseItem `json:"docs"`
}
Response holds the response body struct for the package mget