fieldcaps

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 the information about the capabilities of fields among multiple indices.

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 FieldCaps

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

func New

Returns the information about the capabilities of fields among multiple indices.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html

func (*FieldCaps) AllowNoIndices

func (r *FieldCaps) AllowNoIndices(allownoindices bool) *FieldCaps

AllowNoIndices If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. API name: allow_no_indices

func (FieldCaps) Do

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

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

func (*FieldCaps) ExpandWildcards

func (r *FieldCaps) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *FieldCaps

ExpandWildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. API name: expand_wildcards

func (*FieldCaps) Fields

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

Fields List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. API name: fields

func (*FieldCaps) Filters

func (r *FieldCaps) Filters(filters string) *FieldCaps

Filters An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent API name: filters

func (*FieldCaps) Header

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

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

func (*FieldCaps) HttpRequest

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

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

func (*FieldCaps) IgnoreUnavailable

func (r *FieldCaps) IgnoreUnavailable(ignoreunavailable bool) *FieldCaps

IgnoreUnavailable If `true`, missing or closed indices are not included in the response. API name: ignore_unavailable

func (*FieldCaps) IncludeEmptyFields added in v8.13.0

func (r *FieldCaps) IncludeEmptyFields(includeemptyfields bool) *FieldCaps

IncludeEmptyFields If false, empty fields are not included in the response. API name: include_empty_fields

func (*FieldCaps) IncludeUnmapped

func (r *FieldCaps) IncludeUnmapped(includeunmapped bool) *FieldCaps

IncludeUnmapped If true, unmapped fields are included in the response. API name: include_unmapped

func (*FieldCaps) Index

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

Index Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all. API Name: index

func (*FieldCaps) IndexFilter added in v8.9.0

func (r *FieldCaps) IndexFilter(indexfilter *types.Query) *FieldCaps

IndexFilter Allows to filter indices if the provided query rewrites to match_none on every shard. API name: index_filter

func (FieldCaps) Perform added in v8.7.0

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

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

func (*FieldCaps) Raw

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

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

func (*FieldCaps) Request

func (r *FieldCaps) Request(req *Request) *FieldCaps

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

func (*FieldCaps) RuntimeMappings added in v8.9.0

func (r *FieldCaps) RuntimeMappings(runtimefields types.RuntimeFields) *FieldCaps

RuntimeMappings Defines ad-hoc runtime fields in the request similar to the way it is done in search requests. These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings. API name: runtime_mappings

func (*FieldCaps) Types

func (r *FieldCaps) Types(types ...string) *FieldCaps

Types Only return results for fields that have one of the types in the list API name: types

type NewFieldCaps

type NewFieldCaps func() *FieldCaps

NewFieldCaps type alias for index.

func NewFieldCapsFunc

func NewFieldCapsFunc(tp elastictransport.Interface) NewFieldCaps

NewFieldCapsFunc returns a new instance of FieldCaps 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 {

	// Fields List of fields to retrieve capabilities for. Wildcard (`*`) expressions are
	// supported.
	Fields []string `json:"fields,omitempty"`
	// IndexFilter Allows to filter indices if the provided query rewrites to match_none on
	// every shard.
	IndexFilter *types.Query `json:"index_filter,omitempty"`
	// RuntimeMappings Defines ad-hoc runtime fields in the request similar to the way it is done in
	// search requests.
	// These fields exist only as part of the query and take precedence over fields
	// defined with the same name in the index mappings.
	RuntimeMappings types.RuntimeFields `json:"runtime_mappings,omitempty"`
}

Request holds the request body struct for the package fieldcaps

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/_global/field_caps/FieldCapabilitiesRequest.ts#L25-L106

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

func (*Request) UnmarshalJSON added in v8.12.1

func (s *Request) UnmarshalJSON(data []byte) error

type Response added in v8.7.0

type Response struct {
	Fields  map[string]map[string]types.FieldCapability `json:"fields"`
	Indices []string                                    `json:"indices"`
}

Response holds the response body struct for the package fieldcaps

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/_global/field_caps/FieldCapabilitiesResponse.ts#L24-L35

func NewResponse added in v8.7.0

func NewResponse() *Response

NewResponse returns a Response

func (*Response) UnmarshalJSON added in v8.7.1

func (s *Response) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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