diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs index 9be4f8fb4c2..cce890562f2 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs @@ -133,7 +133,7 @@ protected ElasticsearchClientSettingsBase( _sourceSerializer = sourceSerializerFactory?.Invoke(sourceSerializer, this) ?? sourceSerializer; _propertyMappingProvider = propertyMappingProvider ?? sourceSerializer as IPropertyMappingProvider ?? new DefaultPropertyMappingProvider(); - _defaultFieldNameInferrer = p => p.ToCamelCase(); + _defaultFieldNameInferrer = (_sourceSerializer is DefaultSourceSerializer dfs) ? p => dfs.Options?.PropertyNamingPolicy?.ConvertName(p) ?? p : p => p.ToCamelCase(); _defaultIndices = new FluentDictionary(); _defaultRelationNames = new FluentDictionary(); _inferrer = new Inferrer(this);