mtermvectors

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

Documentation

Overview

Returns multiple termvectors in one request.

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 Mtermvectors

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

func (Mtermvectors) Do

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

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

func (*Mtermvectors) Docs added in v8.9.0

Docs Array of existing or artificial documents. API name: docs

func (*Mtermvectors) FieldStatistics

func (r *Mtermvectors) FieldStatistics(fieldstatistics bool) *Mtermvectors

FieldStatistics If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. API name: field_statistics

func (*Mtermvectors) Fields

func (r *Mtermvectors) Fields(fields ...string) *Mtermvectors

Fields Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. API name: fields

func (*Mtermvectors) Header

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

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

func (*Mtermvectors) HttpRequest

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

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

func (*Mtermvectors) Ids

func (r *Mtermvectors) Ids(ids ...string) *Mtermvectors

Ids Simplified syntax to specify documents by their ID if they're in the same index. API name: ids

func (*Mtermvectors) Index

func (r *Mtermvectors) Index(index string) *Mtermvectors

Index Name of the index that contains the documents. API Name: index

func (*Mtermvectors) Offsets

func (r *Mtermvectors) Offsets(offsets bool) *Mtermvectors

Offsets If `true`, the response includes term offsets. API name: offsets

func (*Mtermvectors) Payloads

func (r *Mtermvectors) Payloads(payloads bool) *Mtermvectors

Payloads If `true`, the response includes term payloads. API name: payloads

func (Mtermvectors) Perform added in v8.7.0

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

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

func (*Mtermvectors) Positions

func (r *Mtermvectors) Positions(positions bool) *Mtermvectors

Positions If `true`, the response includes term positions. API name: positions

func (*Mtermvectors) Preference

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

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

func (*Mtermvectors) Raw

func (r *Mtermvectors) Raw(raw io.Reader) *Mtermvectors

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*Mtermvectors) Realtime

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

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

func (*Mtermvectors) Request

func (r *Mtermvectors) Request(req *Request) *Mtermvectors

Request allows to set the request property with the appropriate payload.

func (*Mtermvectors) Routing

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

Routing Custom value used to route operations to a specific shard. API name: routing

func (*Mtermvectors) TermStatistics

func (r *Mtermvectors) TermStatistics(termstatistics bool) *Mtermvectors

TermStatistics If true, the response includes term frequency and document frequency. API name: term_statistics

func (*Mtermvectors) Version

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

Version If `true`, returns the document version as part of a hit. API name: version

func (*Mtermvectors) VersionType

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

VersionType Specific version type. API name: version_type

type NewMtermvectors

type NewMtermvectors func() *Mtermvectors

NewMtermvectors type alias for index.

func NewMtermvectorsFunc

func NewMtermvectorsFunc(tp elastictransport.Interface) NewMtermvectors

NewMtermvectorsFunc returns a new instance of Mtermvectors 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 Array of existing or artificial documents.
	Docs []types.MTermVectorsOperation `json:"docs,omitempty"`
	// Ids Simplified syntax to specify documents by their ID if they're in the same
	// index.
	Ids []string `json:"ids,omitempty"`
}

Request holds the request body struct for the package mtermvectors

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/_global/mtermvectors/MultiTermVectorsRequest.ts#L31-L109

func NewRequest added in v8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.5.0

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

type Response added in v8.7.0

type Response struct {
	Docs []types.TermVectorsResult `json:"docs"`
}

Response holds the response body struct for the package mtermvectors

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/_global/mtermvectors/MultiTermVectorsResponse.ts#L22-L24

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