Documentation
¶
Overview ¶
Updates the index mappings.
Index ¶
- Variables
- type NewPutMapping
- type PutMapping
- func (r *PutMapping) AllowNoIndices(b bool) *PutMapping
- func (r PutMapping) Do(ctx context.Context) (*http.Response, error)
- func (r *PutMapping) ExpandWildcards(value string) *PutMapping
- func (r *PutMapping) Header(key, value string) *PutMapping
- func (r *PutMapping) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PutMapping) IgnoreUnavailable(b bool) *PutMapping
- func (r *PutMapping) Index(v string) *PutMapping
- func (r *PutMapping) MasterTimeout(value string) *PutMapping
- func (r *PutMapping) Raw(raw json.RawMessage) *PutMapping
- func (r *PutMapping) Request(req *Request) *PutMapping
- func (r *PutMapping) Timeout(value string) *PutMapping
- func (r *PutMapping) WriteIndexOnly(b bool) *PutMapping
- type Request
- type RequestBuilder
- func (rb *RequestBuilder) Build() *Request
- func (rb *RequestBuilder) DateDetection(datedetection bool) *RequestBuilder
- func (rb *RequestBuilder) Dynamic(dynamic dynamicmapping.DynamicMapping) *RequestBuilder
- func (rb *RequestBuilder) DynamicDateFormats(dynamic_date_formats ...string) *RequestBuilder
- func (rb *RequestBuilder) DynamicTemplates(arg []map[string]types.DynamicTemplate) *RequestBuilder
- func (rb *RequestBuilder) FieldNames_(fieldnames_ *types.FieldNamesFieldBuilder) *RequestBuilder
- func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
- func (rb *RequestBuilder) Meta_(meta_ *types.MetadataBuilder) *RequestBuilder
- func (rb *RequestBuilder) NumericDetection(numericdetection bool) *RequestBuilder
- func (rb *RequestBuilder) Properties(values map[types.PropertyName]*types.PropertyBuilder) *RequestBuilder
- func (rb *RequestBuilder) Routing_(routing_ *types.RoutingFieldBuilder) *RequestBuilder
- func (rb *RequestBuilder) Runtime(runtime *types.RuntimeFieldsBuilder) *RequestBuilder
- func (rb *RequestBuilder) Source_(source_ *types.SourceFieldBuilder) *RequestBuilder
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 NewPutMapping ¶
type NewPutMapping func(index string) *PutMapping
NewPutMapping type alias for index.
func NewPutMappingFunc ¶
func NewPutMappingFunc(tp elastictransport.Interface) NewPutMapping
NewPutMappingFunc returns a new instance of PutMapping with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PutMapping ¶
type PutMapping struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PutMapping
Updates the index mappings.
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html
func (*PutMapping) AllowNoIndices ¶
func (r *PutMapping) AllowNoIndices(b bool) *PutMapping
AllowNoIndices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) API name: allow_no_indices
func (*PutMapping) ExpandWildcards ¶
func (r *PutMapping) ExpandWildcards(value string) *PutMapping
ExpandWildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. API name: expand_wildcards
func (*PutMapping) Header ¶
func (r *PutMapping) Header(key, value string) *PutMapping
Header set a key, value pair in the PutMapping headers map.
func (*PutMapping) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PutMapping) IgnoreUnavailable ¶
func (r *PutMapping) IgnoreUnavailable(b bool) *PutMapping
IgnoreUnavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) API name: ignore_unavailable
func (*PutMapping) Index ¶
func (r *PutMapping) Index(v string) *PutMapping
Index A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. API Name: index
func (*PutMapping) MasterTimeout ¶
func (r *PutMapping) MasterTimeout(value string) *PutMapping
MasterTimeout Specify timeout for connection to master API name: master_timeout
func (*PutMapping) Raw ¶
func (r *PutMapping) Raw(raw json.RawMessage) *PutMapping
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*PutMapping) Request ¶
func (r *PutMapping) Request(req *Request) *PutMapping
Request allows to set the request property with the appropriate payload.
func (*PutMapping) Timeout ¶
func (r *PutMapping) Timeout(value string) *PutMapping
Timeout Explicit operation timeout API name: timeout
func (*PutMapping) WriteIndexOnly ¶
func (r *PutMapping) WriteIndexOnly(b bool) *PutMapping
WriteIndexOnly When true, applies mappings only to the write index of an alias or data stream API name: write_index_only
type Request ¶
type Request struct { // DateDetection Controls whether dynamic date detection is enabled. DateDetection *bool `json:"date_detection,omitempty"` // Dynamic Controls whether new fields are added dynamically. Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` // DynamicDateFormats If date detection is enabled then new string fields are checked // against 'dynamic_date_formats' and if the value matches then // a new date field is added instead of string. DynamicDateFormats []string `json:"dynamic_date_formats,omitempty"` // DynamicTemplates Specify dynamic templates for the mapping. DynamicTemplates []map[string]types.DynamicTemplate `json:"dynamic_templates,omitempty"` // FieldNames_ Control whether field names are enabled for the index. FieldNames_ *types.FieldNamesField `json:"_field_names,omitempty"` // Meta_ A mapping type can have custom meta data associated with it. These are // not used at all by Elasticsearch, but can be used to store // application-specific metadata. Meta_ *types.Metadata `json:"_meta,omitempty"` // NumericDetection Automatically map strings into numeric data types for all fields. NumericDetection *bool `json:"numeric_detection,omitempty"` // Properties Mapping for a field. For new fields, this mapping can include: // // - Field name // - Field data type // - Mapping parameters Properties map[types.PropertyName]types.Property `json:"properties,omitempty"` // Routing_ Enable making a routing value required on indexed documents. Routing_ *types.RoutingField `json:"_routing,omitempty"` // Runtime Mapping of runtime fields for the index. Runtime *types.RuntimeFields `json:"runtime,omitempty"` // Source_ Control whether the _source field is enabled on the index. Source_ *types.SourceField `json:"_source,omitempty"` }
Request holds the request body struct for the package putmapping
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is the builder API for the putmapping.Request
func NewRequestBuilder ¶
func NewRequestBuilder() *RequestBuilder
NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder
func (*RequestBuilder) Build ¶
func (rb *RequestBuilder) Build() *Request
Build finalize the chain and returns the Request struct.
func (*RequestBuilder) DateDetection ¶
func (rb *RequestBuilder) DateDetection(datedetection bool) *RequestBuilder
func (*RequestBuilder) Dynamic ¶
func (rb *RequestBuilder) Dynamic(dynamic dynamicmapping.DynamicMapping) *RequestBuilder
func (*RequestBuilder) DynamicDateFormats ¶
func (rb *RequestBuilder) DynamicDateFormats(dynamic_date_formats ...string) *RequestBuilder
func (*RequestBuilder) DynamicTemplates ¶
func (rb *RequestBuilder) DynamicTemplates(arg []map[string]types.DynamicTemplate) *RequestBuilder
func (*RequestBuilder) FieldNames_ ¶
func (rb *RequestBuilder) FieldNames_(fieldnames_ *types.FieldNamesFieldBuilder) *RequestBuilder
func (*RequestBuilder) FromJSON ¶
func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
FromJSON allows to load an arbitrary json into the request structure
func (*RequestBuilder) Meta_ ¶
func (rb *RequestBuilder) Meta_(meta_ *types.MetadataBuilder) *RequestBuilder
func (*RequestBuilder) NumericDetection ¶
func (rb *RequestBuilder) NumericDetection(numericdetection bool) *RequestBuilder
func (*RequestBuilder) Properties ¶
func (rb *RequestBuilder) Properties(values map[types.PropertyName]*types.PropertyBuilder) *RequestBuilder
func (*RequestBuilder) Routing_ ¶
func (rb *RequestBuilder) Routing_(routing_ *types.RoutingFieldBuilder) *RequestBuilder
func (*RequestBuilder) Runtime ¶
func (rb *RequestBuilder) Runtime(runtime *types.RuntimeFieldsBuilder) *RequestBuilder
func (*RequestBuilder) Source_ ¶
func (rb *RequestBuilder) Source_(source_ *types.SourceFieldBuilder) *RequestBuilder