Table of Contents

Interface IIndexMappingConvention

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

Defines a convention for configuring Elasticsearch index mappings for projection types.

public interface IIndexMappingConvention

Remarks

Consumers implement this interface to customize how .NET projection types are mapped to Elasticsearch field types. The framework provides DefaultIndexMappingConvention which infers mappings from CLR property types (string → keyword, int → long, etc.).

Usage:

services.AddElasticSearchProjectionStore<OrderSummary>(opts =>
{
    opts.Index.IndexMappingConvention = new TextFieldConvention();
});

Register a custom convention to override default behavior globally, e.g., mapping all strings as text with a keyword sub-field, or applying custom analyzers to specific property name patterns.

Methods

ConfigureMappings(Type, Properties)

Configures the Elasticsearch index mappings for the specified projection type.

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.