Table of Contents

Class DefaultIndexMappingConvention

Namespace
Excalibur.Data.ElasticSearch.Projections
Assembly
Excalibur.Data.ElasticSearch.dll

Default implementation of IIndexMappingConvention that returns the framework's inferred mappings unchanged.

public sealed class DefaultIndexMappingConvention : IIndexMappingConvention
Inheritance
DefaultIndexMappingConvention
Implements
Inherited Members

Remarks

This convention applies the standard CLR-to-Elasticsearch type mapping:

  • string, Guid, enums → keyword
  • int, long, etc. → long
  • float, double, decimal → double
  • DateTime, DateTimeOffset → date
  • bool → boolean

This is the convention used when no custom convention is specified in IndexMappingConvention.

Properties

Instance

Gets the singleton instance of the default convention.

public static DefaultIndexMappingConvention Instance { get; }

Property Value

DefaultIndexMappingConvention

Methods

ConfigureMappings(Type, Properties)

Configures the Elasticsearch index mappings for the specified projection type.

public Properties ConfigureMappings(Type projectionType, Properties inferredProperties)

Parameters

projectionType Type

The .NET projection type being mapped.

inferredProperties Properties

The inferred property mappings from the framework's reflection-based mapping. Implementations may modify, augment, or replace these entirely.

Returns

Properties

The final Elastic.Clients.Elasticsearch.Mapping.Properties to use for index creation. Return inferredProperties unchanged to accept defaults.