Skip to content

Unable to get server side mappings due to unexpected boolean type (string) #4124

@niemyjski

Description

@niemyjski

Elastic 7.4.0 and NEST 7.3.0 are failing when I try to get the index mapping:

Elasticsearch.Net.Utf8Json.JsonParsingException: expected:'true | false', actual:'"false"', at offset:77
  at at Elasticsearch.Net.Utf8Json.JsonReader.ReadBoolean()
  at at Elasticsearch.Net.Utf8Json.Formatters.BooleanFormatter.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)
  at at Nest.UnionFormatter`2.TryRead[T](ArraySegment`1& segment, IJsonFormatterResolver formatterResolver, T& v)
{
  "daily-logevents-v1-2019.10.08" : {
    "mappings" : {
      "dynamic" : "false",
      "properties" : {
        "companyId" : {
          "type" : "keyword"
        },
        "created" : {
          "type" : "alias",
          "path" : "createdUtc"
        },
        "createdUtc" : {
          "type" : "date"
        },
        "id" : {
          "type" : "keyword"
        },
        "message" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "value" : {
          "type" : "integer"
        }
      }
    }
  }
}

image

As you can see I defined dynamic through the nest fluent api and this is breaking.

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