Skip to content

Mapping of byte and short types in MapFromAttributes #1479

@michaeljmx

Description

@michaeljmx

We are using the MapFromAttributes method to create Elasticsearch mapping from classes. We have found out that it doesn't work with properties that have byte and short types.

I've checked the library sources and found out that there is really no support for these types. Here is the part of the GetFieldTypeFromType method from file TypeMappingWriter.cs:

switch (propertyType.Name)
{
    case "Int32":
        return FieldType.Integer;
    case "Int64":
        return FieldType.Long;
    case "Single":
        return FieldType.Float;
    case "Decimal":
    case "Double":
        return FieldType.Double;
    case "DateTime":
        return FieldType.Date;
    case "Boolean":
        return FieldType.Boolean;
}

Could you please fix the issue?

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