elasticsearch-net icon indicating copy to clipboard operation
elasticsearch-net copied to clipboard

CreateIndexDescriptor Mappings -> Map Api usage issue

Open sbodese opened this issue 9 months ago • 1 comments

NEST/Elasticsearch.Net version: 7.15.5

Elasticsearch version: 8.9.0

Description of the problem including expected versus actual behavior:

Steps to reproduce:

  1. use the CreateIndexDescriptor only to validate a mapping

new CreateIndexDescriptor(indexName).Mappings(md => md.Map<TDocument>(m => m.AutoMap(5)));

Or as the new API suggested:

new CreateIndexDescriptor(indexName).Map<TypeMappingDescriptor<TDocument>>(mp => mp.AutoMap(5));

expected is a IndexState object with a correct mapping.

  1. if i use these new API to create only (without settings) a Indexstate with a mapping, i got a empty mapping.

The same APi usage like

descriptor.InitializeUsing(indexState) .Settings(s => s.Setting(UpdatableIndexSettings.MaxNGramDiff, 3)) .Map<TypeMappingDescriptor<TDocument>>(mp => mp.AutoMap(5)); works correctly.

@flobernd Have you an idea please or is this a bug?

sbodese avatar Sep 11 '23 13:09 sbodese