Search Results for

    Show / Hide Table of Contents

    Class PutMappingDescriptor<TDocument>

    Descriptor for PutMapping

    https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/

    Inheritance
    object
    RequestBase<PutMappingRequestParameters>
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>
    PutMappingDescriptor<TDocument>
    Implements
    IDescriptor
    IPutMappingRequest<TDocument>
    IPutMappingRequest
    ITypeMapping
    IRequest<PutMappingRequestParameters>
    IRequest
    Inherited Members
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.Self
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.Assign<TValue>(TValue, Action<IPutMappingRequest<TDocument>, TValue>)
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.Qs(string, object)
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.RequestConfiguration(Func<RequestConfigurationDescriptor, IRequestConfiguration>)
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.ErrorTrace(bool?)
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.FilterPath(params string[])
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.FilterPath(IEnumerable<string>)
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.Human(bool?)
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.Pretty(bool?)
    RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>.SourceQueryString(string)
    RequestBase<PutMappingRequestParameters>.HttpMethod
    RequestBase<PutMappingRequestParameters>.RequestState
    RequestBase<PutMappingRequestParameters>.ContentType
    RequestBase<PutMappingRequestParameters>.ResolveUrl(RouteValues, IConnectionSettingsValues)
    RequestBase<PutMappingRequestParameters>.RequestDefaults(PutMappingRequestParameters)
    RequestBase<PutMappingRequestParameters>.Q<TOut>(string)
    RequestBase<PutMappingRequestParameters>.Q(string, object)
    RequestBase<PutMappingRequestParameters>.SetAcceptHeader(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: OpenSearch.Client
    Assembly: OpenSearch.Client.dll
    Syntax
    [DataContract]
    public class PutMappingDescriptor<TDocument> : RequestDescriptorBase<PutMappingDescriptor<TDocument>, PutMappingRequestParameters, IPutMappingRequest<TDocument>>, IDescriptor, IPutMappingRequest<TDocument>, IPutMappingRequest, ITypeMapping, IRequest<PutMappingRequestParameters>, IRequest where TDocument : class
    Type Parameters
    Name Description
    TDocument

    Constructors

    | Edit this page View Source

    PutMappingDescriptor()

    /{index}/_mapping

    Declaration
    public PutMappingDescriptor()
    | Edit this page View Source

    PutMappingDescriptor(Indices)

    /{index}/_mapping

    Declaration
    public PutMappingDescriptor(Indices index)
    Parameters
    Type Name Description
    Indices index

    this parameter is required

    Methods

    | Edit this page View Source

    AllIndices()

    A shortcut into calling Index(Indices.All)

    Declaration
    public PutMappingDescriptor<TDocument> AllIndices()
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    AllowNoIndices(bool?)

    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 PutMappingDescriptor<TDocument> AllowNoIndices(bool? allownoindices = true)
    Parameters
    Type Name Description
    bool? allownoindices
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    Assign<TValue>(TValue, Action<ITypeMapping, TValue>)

    Declaration
    protected PutMappingDescriptor<TDocument> Assign<TValue>(TValue value, Action<ITypeMapping, TValue> assigner)
    Parameters
    Type Name Description
    TValue value
    Action<ITypeMapping, TValue> assigner
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    Type Parameters
    Name Description
    TValue
    | Edit this page View Source

    AutoMap(IPropertyVisitor, int)

    Convenience method to map as much as it can based on OpenSearchType attributes set on the type.

    This method also automatically sets up mappings for primitive values types (e.g. int, long, double, DateTime...)

    Class types default to object and Enums to int

    Later calls can override whatever is set by this call.

    Declaration
    public PutMappingDescriptor<TDocument> AutoMap(IPropertyVisitor visitor = null, int maxRecursion = 0)
    Parameters
    Type Name Description
    IPropertyVisitor visitor
    int maxRecursion
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    AutoMap(int)

    Convenience method to map as much as it can based on OpenSearchType attributes set on the type.

    This method also automatically sets up mappings for primitive values types (e.g. int, long, double, DateTime...)

    Class types default to object and Enums to int

    Later calls can override whatever is set by this call.

    Declaration
    public PutMappingDescriptor<TDocument> AutoMap(int maxRecursion)
    Parameters
    Type Name Description
    int maxRecursion
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    ClusterManagerTimeout(Time)

    Operation timeout for connection to cluster-manager node.

    Declaration
    public PutMappingDescriptor<TDocument> ClusterManagerTimeout(Time clustermanagertimeout)
    Parameters
    Type Name Description
    Time clustermanagertimeout
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    Remarks

    Supported by OpenSearch servers of version 2.0.0 or greater.

    | Edit this page View Source

    DateDetection(bool?)

    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 PutMappingDescriptor<TDocument> DateDetection(bool? detect = true)
    Parameters
    Type Name Description
    bool? detect
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    DisableSizeField(bool?)

    If enabled, indexes the size in bytes of the original _source field. Requires mapper-size plugin be installed

    Declaration
    public PutMappingDescriptor<TDocument> DisableSizeField(bool? disabled = true)
    Parameters
    Type Name Description
    bool? disabled
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    Dynamic(Union<bool, DynamicMapping>)

    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 PutMappingDescriptor<TDocument> Dynamic(Union<bool, DynamicMapping> dynamic)
    Parameters
    Type Name Description
    Union<bool, DynamicMapping> dynamic
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    Dynamic(bool?)

    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 PutMappingDescriptor<TDocument> Dynamic(bool? dynamic = true)
    Parameters
    Type Name Description
    bool? dynamic
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    DynamicDateFormats(IEnumerable<string>)

    Date formats used by DateDetection

    Declaration
    public PutMappingDescriptor<TDocument> DynamicDateFormats(IEnumerable<string> dateFormats)
    Parameters
    Type Name Description
    IEnumerable<string> dateFormats
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    DynamicTemplates(Func<DynamicTemplateContainerDescriptor<TDocument>, IPromise<IDynamicTemplateContainer>>)

    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 PutMappingDescriptor<TDocument> DynamicTemplates(Func<DynamicTemplateContainerDescriptor<TDocument>, IPromise<IDynamicTemplateContainer>> dynamicTemplatesSelector)
    Parameters
    Type Name Description
    Func<DynamicTemplateContainerDescriptor<TDocument>, IPromise<IDynamicTemplateContainer>> dynamicTemplatesSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    ExpandWildcards(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 PutMappingDescriptor<TDocument> ExpandWildcards(ExpandWildcards? expandwildcards)
    Parameters
    Type Name Description
    ExpandWildcards? expandwildcards
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    FieldNamesField(Func<FieldNamesFieldDescriptor<TDocument>, IFieldNamesField>)

    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 PutMappingDescriptor<TDocument> FieldNamesField(Func<FieldNamesFieldDescriptor<TDocument>, IFieldNamesField> fieldNamesFieldSelector)
    Parameters
    Type Name Description
    Func<FieldNamesFieldDescriptor<TDocument>, IFieldNamesField> fieldNamesFieldSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    IgnoreUnavailable(bool?)

    If false, the request returns an error if it targets a missing or closed index.

    Declaration
    public PutMappingDescriptor<TDocument> IgnoreUnavailable(bool? ignoreunavailable = true)
    Parameters
    Type Name Description
    bool? ignoreunavailable
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    IncludeTypeName(bool?)

    Whether a type should be expected in the body of the mappings.

    Declaration
    public PutMappingDescriptor<TDocument> IncludeTypeName(bool? includetypename = true)
    Parameters
    Type Name Description
    bool? includetypename
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    Remarks

    Deprecated as of OpenSearch 2.0

    | Edit this page View Source

    Index(Indices)

    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 indexes.

    Declaration
    public PutMappingDescriptor<TDocument> Index(Indices index)
    Parameters
    Type Name Description
    Indices index
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    Index<TOther>()

    a shortcut into calling Index(typeof(TOther))

    Declaration
    public PutMappingDescriptor<TDocument> Index<TOther>() where TOther : class
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    MasterTimeout(Time)

    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 PutMappingDescriptor<TDocument> MasterTimeout(Time mastertimeout)
    Parameters
    Type Name Description
    Time mastertimeout
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    Meta(Dictionary<string, object>)

    Custom meta data to associate with a mapping. Not used by OpenSearch, but can be used to store application-specific metadata.

    Declaration
    public PutMappingDescriptor<TDocument> Meta(Dictionary<string, object> metaDictionary)
    Parameters
    Type Name Description
    Dictionary<string, object> metaDictionary
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    Meta(Func<FluentDictionary<string, object>, FluentDictionary<string, object>>)

    Custom meta data to associate with a mapping. Not used by OpenSearch, but can be used to store application-specific metadata.

    Declaration
    public PutMappingDescriptor<TDocument> Meta(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> metaSelector)
    Parameters
    Type Name Description
    Func<FluentDictionary<string, object>, FluentDictionary<string, object>> metaSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    NumericDetection(bool?)

    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 PutMappingDescriptor<TDocument> NumericDetection(bool? detect = true)
    Parameters
    Type Name Description
    bool? detect
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    Properties(Func<PropertiesDescriptor<TDocument>, IPromise<IProperties>>)

    Specifies the mapping properties

    Declaration
    public PutMappingDescriptor<TDocument> Properties(Func<PropertiesDescriptor<TDocument>, IPromise<IProperties>> propertiesSelector)
    Parameters
    Type Name Description
    Func<PropertiesDescriptor<TDocument>, IPromise<IProperties>> propertiesSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    RoutingField(Func<RoutingFieldDescriptor<TDocument>, IRoutingField>)

    Specifies configuration for the _routing parameter

    Declaration
    public PutMappingDescriptor<TDocument> RoutingField(Func<RoutingFieldDescriptor<TDocument>, IRoutingField> routingFieldSelector)
    Parameters
    Type Name Description
    Func<RoutingFieldDescriptor<TDocument>, IRoutingField> routingFieldSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    RuntimeFields(Func<RuntimeFieldsDescriptor<TDocument>, IPromise<IRuntimeFields>>)

    Specifies runtime fields for the mapping.

    Declaration
    public PutMappingDescriptor<TDocument> RuntimeFields(Func<RuntimeFieldsDescriptor<TDocument>, IPromise<IRuntimeFields>> runtimeFieldsSelector)
    Parameters
    Type Name Description
    Func<RuntimeFieldsDescriptor<TDocument>, IPromise<IRuntimeFields>> runtimeFieldsSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    RuntimeFields<TSource>(Func<RuntimeFieldsDescriptor<TSource>, IPromise<IRuntimeFields>>)

    Specifies runtime fields for the mapping.

    Declaration
    public PutMappingDescriptor<TDocument> RuntimeFields<TSource>(Func<RuntimeFieldsDescriptor<TSource>, IPromise<IRuntimeFields>> runtimeFieldsSelector) where TSource : class
    Parameters
    Type Name Description
    Func<RuntimeFieldsDescriptor<TSource>, IPromise<IRuntimeFields>> runtimeFieldsSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    Type Parameters
    Name Description
    TSource
    | Edit this page View Source

    SizeField(Func<SizeFieldDescriptor, ISizeField>)

    If enabled, indexes the size in bytes of the original _source field. Requires mapper-size plugin be installed

    Declaration
    public PutMappingDescriptor<TDocument> SizeField(Func<SizeFieldDescriptor, ISizeField> sizeFieldSelector)
    Parameters
    Type Name Description
    Func<SizeFieldDescriptor, ISizeField> sizeFieldSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    SourceField(Func<SourceFieldDescriptor, ISourceField>)

    Specifies configuration for the _source field

    Declaration
    public PutMappingDescriptor<TDocument> SourceField(Func<SourceFieldDescriptor, ISourceField> sourceFieldSelector)
    Parameters
    Type Name Description
    Func<SourceFieldDescriptor, ISourceField> sourceFieldSelector
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    Timeout(Time)

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

    Declaration
    public PutMappingDescriptor<TDocument> Timeout(Time timeout)
    Parameters
    Type Name Description
    Time timeout
    Returns
    Type Description
    PutMappingDescriptor<TDocument>
    | Edit this page View Source

    WriteIndexOnly(bool?)

    If true, the mappings are applied only to the current write index for the target.

    Declaration
    public PutMappingDescriptor<TDocument> WriteIndexOnly(bool? writeindexonly = true)
    Parameters
    Type Name Description
    bool? writeindexonly
    Returns
    Type Description
    PutMappingDescriptor<TDocument>

    Implements

    IDescriptor
    IPutMappingRequest<TDocument>
    IPutMappingRequest
    ITypeMapping
    IRequest<TParameters>
    IRequest

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Constructors
      • PutMappingDescriptor()
      • PutMappingDescriptor(Indices)
    • Methods
      • AllIndices()
      • AllowNoIndices(bool?)
      • Assign<TValue>(TValue, Action<ITypeMapping, TValue>)
      • AutoMap(IPropertyVisitor, int)
      • AutoMap(int)
      • ClusterManagerTimeout(Time)
      • DateDetection(bool?)
      • DisableSizeField(bool?)
      • Dynamic(Union<bool, DynamicMapping>)
      • Dynamic(bool?)
      • DynamicDateFormats(IEnumerable<string>)
      • DynamicTemplates(Func<DynamicTemplateContainerDescriptor<TDocument>, IPromise<IDynamicTemplateContainer>>)
      • ExpandWildcards(ExpandWildcards?)
      • FieldNamesField(Func<FieldNamesFieldDescriptor<TDocument>, IFieldNamesField>)
      • IgnoreUnavailable(bool?)
      • IncludeTypeName(bool?)
      • Index(Indices)
      • Index<TOther>()
      • MasterTimeout(Time)
      • Meta(Dictionary<string, object>)
      • Meta(Func<FluentDictionary<string, object>, FluentDictionary<string, object>>)
      • NumericDetection(bool?)
      • Properties(Func<PropertiesDescriptor<TDocument>, IPromise<IProperties>>)
      • RoutingField(Func<RoutingFieldDescriptor<TDocument>, IRoutingField>)
      • RuntimeFields(Func<RuntimeFieldsDescriptor<TDocument>, IPromise<IRuntimeFields>>)
      • RuntimeFields<TSource>(Func<RuntimeFieldsDescriptor<TSource>, IPromise<IRuntimeFields>>)
      • SizeField(Func<SizeFieldDescriptor, ISizeField>)
      • SourceField(Func<SourceFieldDescriptor, ISourceField>)
      • Timeout(Time)
      • WriteIndexOnly(bool?)
    • Implements
    • Extension Methods
    Back to top Generated by DocFX