putmapping

package
v8.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Overview

Updates the index mappings.

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 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 (*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) Do

func (r PutMapping) Do(ctx context.Context) (*http.Response, error)

Do runs the http.Request through the provided transport.

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

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

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

https://github.com/elastic/elasticsearch-specification/blob/4316fc1aa18bb04678b156f23b22c9d3f996f9c9/specification/indices/put_mapping/IndicesPutMappingRequest.ts#L42-L116

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 (*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 (*RequestBuilder) NumericDetection

func (rb *RequestBuilder) NumericDetection(numericdetection bool) *RequestBuilder

func (*RequestBuilder) Properties

func (*RequestBuilder) Routing_

func (rb *RequestBuilder) Routing_(routing_ *types.RoutingFieldBuilder) *RequestBuilder

func (*RequestBuilder) Runtime

func (*RequestBuilder) Source_

func (rb *RequestBuilder) Source_(source_ *types.SourceFieldBuilder) *RequestBuilder

Jump to

Keyboard shortcuts

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