Search Results for

    Show / Hide Table of Contents

    Class TypeMappingDescriptor<T>

    Inheritance
    object
    DescriptorBase<TypeMappingDescriptor<T>, ITypeMapping>
    TypeMappingDescriptor<T>
    Implements
    IDescriptor
    ITypeMapping
    Inherited Members
    DescriptorBase<TypeMappingDescriptor<T>, ITypeMapping>.Self
    DescriptorBase<TypeMappingDescriptor<T>, ITypeMapping>.Assign<TValue>(TValue, Action<ITypeMapping, TValue>)
    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
    public class TypeMappingDescriptor<T> : DescriptorBase<TypeMappingDescriptor<T>, ITypeMapping>, IDescriptor, ITypeMapping where T : class
    Type Parameters
    Name Description
    T

    Methods

    | Edit this page View Source

    AutoMap(IPropertyVisitor, int)

    Convenience method to map as much as it can based on OpenSearchTypeAttribute attributes set on the type, as well as inferring mappings from the CLR property types.

    This method also automatically sets up mappings for known values types (int, long, double, datetime, etc)
    Class types default to object and Enums to int
    Later calls can override whatever is set is by this call.
    Declaration
    public TypeMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int maxRecursion = 0)
    Parameters
    Type Name Description
    IPropertyVisitor visitor
    int maxRecursion
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | Edit this page View Source

    AutoMap(int)

    Convenience method to map as much as it can based on OpenSearchTypeAttribute attributes set on the type, as well as inferring mappings from the CLR property types. This overload determines how deep automapping should recurse on a complex CLR type.

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

    AutoMap(Type, IPropertyVisitor, int)

    Convenience method to map as much as it can based on OpenSearchTypeAttribute attributes set on the type, as well as inferring mappings from the CLR property types. This particular overload is useful for automapping any children

    This method also automatically sets up mappings for known values types (int, long, double, datetime, etc)
    Class types default to object and Enums to int
    Later calls can override whatever is set is by this call.
    Declaration
    public TypeMappingDescriptor<T> AutoMap(Type documentType, IPropertyVisitor visitor = null, int maxRecursion = 0)
    Parameters
    Type Name Description
    Type documentType
    IPropertyVisitor visitor
    int maxRecursion
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | Edit this page View Source

    AutoMap<TDocument>(IPropertyVisitor, int)

    Convenience method to map as much as it can based on OpenSearchTypeAttribute attributes set on the type, as well as inferring mappings from the CLR property types. This particular overload is useful for automapping any children

    This method also automatically sets up mappings for known values types (int, long, double, datetime, etc)
    Class types default to object and Enums to int
    Later calls can override whatever is set is by this call.
    Declaration
    public TypeMappingDescriptor<T> AutoMap<TDocument>(IPropertyVisitor visitor = null, int maxRecursion = 0) where TDocument : class
    Parameters
    Type Name Description
    IPropertyVisitor visitor
    int maxRecursion
    Returns
    Type Description
    TypeMappingDescriptor<T>
    Type Parameters
    Name Description
    TDocument
    | 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 TypeMappingDescriptor<T> DateDetection(bool? detect = true)
    Parameters
    Type Name Description
    bool? detect
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | 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 TypeMappingDescriptor<T> DisableSizeField(bool? disabled = true)
    Parameters
    Type Name Description
    bool? disabled
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | 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 TypeMappingDescriptor<T> Dynamic(Union<bool, DynamicMapping> dynamic)
    Parameters
    Type Name Description
    Union<bool, DynamicMapping> dynamic
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | 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 TypeMappingDescriptor<T> Dynamic(bool dynamic = true)
    Parameters
    Type Name Description
    bool dynamic
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | Edit this page View Source

    DynamicDateFormats(IEnumerable<string>)

    Date formats used by DateDetection

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

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

    FieldNamesField(Func<FieldNamesFieldDescriptor<T>, 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 TypeMappingDescriptor<T> FieldNamesField(Func<FieldNamesFieldDescriptor<T>, IFieldNamesField> fieldNamesFieldSelector)
    Parameters
    Type Name Description
    Func<FieldNamesFieldDescriptor<T>, IFieldNamesField> fieldNamesFieldSelector
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | 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 TypeMappingDescriptor<T> Meta(Dictionary<string, object> metaDictionary)
    Parameters
    Type Name Description
    Dictionary<string, object> metaDictionary
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | 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 TypeMappingDescriptor<T> Meta(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> metaSelector)
    Parameters
    Type Name Description
    Func<FluentDictionary<string, object>, FluentDictionary<string, object>> metaSelector
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | 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 TypeMappingDescriptor<T> NumericDetection(bool? detect = true)
    Parameters
    Type Name Description
    bool? detect
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | Edit this page View Source

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

    Specifies the mapping properties

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

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

    Specifies the mapping properties

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

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

    Specifies configuration for the _routing parameter

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

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

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

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

    Specifies runtime fields for the mapping.

    Declaration
    public TypeMappingDescriptor<T> RuntimeFields<TDocument>(Func<RuntimeFieldsDescriptor<TDocument>, IPromise<IRuntimeFields>> runtimeFieldsSelector) where TDocument : class
    Parameters
    Type Name Description
    Func<RuntimeFieldsDescriptor<TDocument>, IPromise<IRuntimeFields>> runtimeFieldsSelector
    Returns
    Type Description
    TypeMappingDescriptor<T>
    Type Parameters
    Name Description
    TDocument
    | 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 TypeMappingDescriptor<T> SizeField(Func<SizeFieldDescriptor, ISizeField> sizeFieldSelector)
    Parameters
    Type Name Description
    Func<SizeFieldDescriptor, ISizeField> sizeFieldSelector
    Returns
    Type Description
    TypeMappingDescriptor<T>
    | Edit this page View Source

    SourceField(Func<SourceFieldDescriptor, ISourceField>)

    Specifies configuration for the _source field

    Declaration
    public TypeMappingDescriptor<T> SourceField(Func<SourceFieldDescriptor, ISourceField> sourceFieldSelector)
    Parameters
    Type Name Description
    Func<SourceFieldDescriptor, ISourceField> sourceFieldSelector
    Returns
    Type Description
    TypeMappingDescriptor<T>

    Implements

    IDescriptor
    ITypeMapping

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Methods
      • AutoMap(IPropertyVisitor, int)
      • AutoMap(int)
      • AutoMap(Type, IPropertyVisitor, int)
      • AutoMap<TDocument>(IPropertyVisitor, int)
      • DateDetection(bool?)
      • DisableSizeField(bool?)
      • Dynamic(Union<bool, DynamicMapping>)
      • Dynamic(bool)
      • DynamicDateFormats(IEnumerable<string>)
      • DynamicTemplates(Func<DynamicTemplateContainerDescriptor<T>, IPromise<IDynamicTemplateContainer>>)
      • FieldNamesField(Func<FieldNamesFieldDescriptor<T>, IFieldNamesField>)
      • Meta(Dictionary<string, object>)
      • Meta(Func<FluentDictionary<string, object>, FluentDictionary<string, object>>)
      • NumericDetection(bool?)
      • Properties(Func<PropertiesDescriptor<T>, IPromise<IProperties>>)
      • Properties<TDocument>(Func<PropertiesDescriptor<TDocument>, IPromise<IProperties>>)
      • RoutingField(Func<RoutingFieldDescriptor<T>, IRoutingField>)
      • RuntimeFields(Func<RuntimeFieldsDescriptor<T>, IPromise<IRuntimeFields>>)
      • RuntimeFields<TDocument>(Func<RuntimeFieldsDescriptor<TDocument>, IPromise<IRuntimeFields>>)
      • SizeField(Func<SizeFieldDescriptor, ISizeField>)
      • SourceField(Func<SourceFieldDescriptor, ISourceField>)
    • Implements
    • Extension Methods
    Back to top Generated by DocFX