Class PutMappingRequest
Request for PutMapping
https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/
Inheritance
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
[DataContract]
public class PutMappingRequest : PlainRequestBase<PutMappingRequestParameters>, IPutMappingRequest, ITypeMapping, IRequest<PutMappingRequestParameters>, IRequest
Constructors
| Edit this page View SourcePutMappingRequest()
Used for serialization purposes, making sure we have a parameterless constructor
Declaration
protected PutMappingRequest()
PutMappingRequest(Indices)
/{index}/_mapping
Declaration
public PutMappingRequest(Indices index)
Parameters
| Type | Name | Description |
|---|---|---|
| Indices | index | this parameter is required |
Properties
| Edit this page View SourceAllowNoIndices
If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed
indexes. This behavior applies even if the request targets other open indexes.
Declaration
public bool? AllowNoIndices { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
ClusterManagerTimeout
Operation timeout for connection to cluster-manager node.
Declaration
public Time ClusterManagerTimeout { get; set; }
Property Value
| Type | Description |
|---|---|
| Time |
Remarks
Supported by OpenSearch servers of version 2.0.0 or greater.
DateDetection
If enabled (default), then new string fields are checked to see whether their contents match any of the date patterns specified in DynamicDateFormats. If a match is found, a new date field is added with the corresponding format.
Declaration
public bool? DateDetection { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Dynamic
Whether new unseen fields will be added to the mapping. Default is true.
A value of false will ignore unknown fields and a value of Strict
will result in an error if an unknown field is encountered in a document.
Declaration
public Union<bool, DynamicMapping> Dynamic { get; set; }
Property Value
| Type | Description |
|---|---|
| Union<bool, DynamicMapping> |
DynamicDateFormats
Date formats used by DateDetection
Declaration
public IEnumerable<string> DynamicDateFormats { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
DynamicTemplates
Dynamic templates allow you to define custom mappings that can be applied to dynamically added fields based on
- the datatype detected by OpenSearch, with MatchMappingType.
- the name of the field, with Match and Unmatch or MatchPattern.
- the full dotted path to the field, with PathMatch and PathUnmatch.
The original field name {name} and the detected datatype {dynamic_type} template variables can be
used in the mapping specification as placeholders.
Declaration
public IDynamicTemplateContainer DynamicTemplates { get; set; }
Property Value
| Type | Description |
|---|---|
| IDynamicTemplateContainer |
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. Valid values are: all,
open, closed, hidden, none.
Declaration
public ExpandWildcards? ExpandWildcards { get; set; }
Property Value
| Type | Description |
|---|---|
| ExpandWildcards? |
FieldNamesField
Used to index the names of every field in a document that contains any value other than null. This field was used by the exists query to find documents that either have or don’t have any non-null value for a particular field. Now, it only indexes the names of fields that have doc_values and norms disabled. Can be disabled. Disabling _field_names is often not necessary because it no longer carries the index overhead it once did. If you have a lot of fields which have doc_values and norms disabled and you do not need to execute exists queries using those fields you might want to disable
Declaration
public IFieldNamesField FieldNamesField { get; set; }
Property Value
| Type | Description |
|---|---|
| IFieldNamesField |
IgnoreUnavailable
If false, the request returns an error if it targets a missing or closed index.
Declaration
public bool? IgnoreUnavailable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
IncludeTypeName
Whether a type should be expected in the body of the mappings.
Declaration
public bool? IncludeTypeName { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Remarks
Deprecated as of OpenSearch 2.0
MasterTimeout
Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.
Declaration
[Obsolete("Deprecated as of: 2.0.0, reason: To promote inclusive language, use `cluster_manager_timeout` instead.")]
public Time MasterTimeout { get; set; }
Property Value
| Type | Description |
|---|---|
| Time |
Meta
Custom meta data to associate with a mapping. Not used by OpenSearch, but can be used to store application-specific metadata.
Declaration
public IDictionary<string, object> Meta { get; set; }
Property Value
| Type | Description |
|---|---|
| IDictionary<string, object> |
NumericDetection
If enabled (not enabled by default), then new string fields are checked to see whether they wholly contain a numeric value and if so, to map as a numeric field.
Declaration
public bool? NumericDetection { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Properties
Specifies the mapping properties
Declaration
public IProperties Properties { get; set; }
Property Value
| Type | Description |
|---|---|
| IProperties |
RoutingField
Specifies configuration for the _routing parameter
Declaration
public IRoutingField RoutingField { get; set; }
Property Value
| Type | Description |
|---|---|
| IRoutingField |
RuntimeFields
Specifies runtime fields for the mapping.
Declaration
public IRuntimeFields RuntimeFields { get; set; }
Property Value
| Type | Description |
|---|---|
| IRuntimeFields |
Self
Declaration
protected IPutMappingRequest Self { get; }
Property Value
| Type | Description |
|---|---|
| IPutMappingRequest |
SizeField
If enabled, indexes the size in bytes of the original _source field. Requires mapper-size plugin be installed
Declaration
public ISizeField SizeField { get; set; }
Property Value
| Type | Description |
|---|---|
| ISizeField |
SourceField
Specifies configuration for the _source field
Declaration
public ISourceField SourceField { get; set; }
Property Value
| Type | Description |
|---|---|
| ISourceField |
Timeout
Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
Declaration
public Time Timeout { get; set; }
Property Value
| Type | Description |
|---|---|
| Time |
WriteIndexOnly
If true, the mappings are applied only to the current write index for the target.
Declaration
public bool? WriteIndexOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |