Documentation ¶
Overview ¶
Returns the information about the capabilities of fields among multiple indices.
Index ¶
- Variables
- type FieldCaps
- func (r *FieldCaps) AllowNoIndices(allownoindices bool) *FieldCaps
- func (r FieldCaps) Do(providedCtx context.Context) (*Response, error)
- func (r *FieldCaps) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *FieldCaps
- func (r *FieldCaps) Fields(fields ...string) *FieldCaps
- func (r *FieldCaps) Filters(filters string) *FieldCaps
- func (r *FieldCaps) Header(key, value string) *FieldCaps
- func (r *FieldCaps) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *FieldCaps) IgnoreUnavailable(ignoreunavailable bool) *FieldCaps
- func (r *FieldCaps) IncludeEmptyFields(includeemptyfields bool) *FieldCaps
- func (r *FieldCaps) IncludeUnmapped(includeunmapped bool) *FieldCaps
- func (r *FieldCaps) Index(index string) *FieldCaps
- func (r *FieldCaps) IndexFilter(indexfilter *types.Query) *FieldCaps
- func (r FieldCaps) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *FieldCaps) Raw(raw io.Reader) *FieldCaps
- func (r *FieldCaps) Request(req *Request) *FieldCaps
- func (r *FieldCaps) RuntimeMappings(runtimefields types.RuntimeFields) *FieldCaps
- func (r *FieldCaps) Types(types ...string) *FieldCaps
- type NewFieldCaps
- 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 FieldCaps ¶
type FieldCaps struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *FieldCaps
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 ¶
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 ¶
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 ¶
Fields List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. API name: fields
func (*FieldCaps) Filters ¶
Filters An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent API name: filters
func (*FieldCaps) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*FieldCaps) IgnoreUnavailable ¶
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
IncludeEmptyFields If false, empty fields are not included in the response. API name: include_empty_fields
func (*FieldCaps) IncludeUnmapped ¶
IncludeUnmapped If true, unmapped fields are included in the response. API name: include_unmapped
func (*FieldCaps) Index ¶
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
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
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*FieldCaps) 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 (*FieldCaps) Request ¶
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
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
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 { Fields map[string]map[string]types.FieldCapability `json:"fields"` Indices []string `json:"indices"` }
Response holds the response body struct for the package fieldcaps