Skip to content

CreateIndexDescriptor Mappings -> Map Api usage issue #7929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sbodese opened this issue Sep 11, 2023 · 1 comment
Closed

CreateIndexDescriptor Mappings -> Map Api usage issue #7929

sbodese opened this issue Sep 11, 2023 · 1 comment
Labels
7.x Relates to a 7.x client version Category: Bug

Comments

@sbodese
Copy link

sbodese commented Sep 11, 2023

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 sbodese changed the title CreatIndexDescriptor Mappings -> Map Api usage issue CreateIndexDescriptor Mappings -> Map Api usage issue Sep 11, 2023
@sbodese
Copy link
Author

sbodese commented Sep 13, 2023

Further, i got a "strange" index response if i use the newer api call with this nest client 7.17.5, the delivered mappings doesnt contains the mapping field attribute "index=false" vs the older Mapping Function call

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

creates:

  "token": {
    "fields": {
      "keyword": {
        "ignore_above": 256,
        "type": "keyword"
      }
    },
    "type": "text"
  }

versus the expected JSON

{
  "token": {
    "index": false,
    "type": "text"
  },

it seems thats here is something wrong ?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.x Relates to a 7.x client version Category: Bug
Projects
None yet
Development

No branches or pull requests

2 participants