Skip to content

[5.0 Breaking] Incorrect numeric NumberType mappings are created. #2368

@niemyjski

Description

@niemyjski

In 1.x client the mappings were (mostly, with a bigger datatype) correctly created, now with the 5.x mappings everything I've come across seems to be mapped to a float.. It seems we are not setting the correct NumberType.

.Number(f => f.Name(e => e.Value).Alias(Alias.Value)) // value is of type decimal?
.Number(f => f.Name(e => e.Count).Alias(Alias.Count)) // count is of type int?

previous versions of the mapping would have created these as (mostly) correct types:

{
               "value": {
                  "type": "double",
                  "include_in_all": false
               },
               "count": {
                  "type": "double",
                  "include_in_all": false
               },
}

However, they are currently being submitted as

{
          "value": {
            "type": "float"
          },
          "count": {
            "type": "float"
          }
}

Looking at https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html the types should be

{
          "value": {
            "type": "double"
          },
          "count": {
            "type": "integer"
          }
}

The value here, I wonder should be double or maybe a scaled_float ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions