Index creation failing using Nest 7.6.1 with "Root mapping definition has unsupported parameters"


Im trying to create index for a very simple class. My class :

    public class ElasticSearchDto
        public string Id { get; set; }
        public string ApplicationNumber { get; set; }

Using the following code to create my index (using Elasticsearch.Net.Aws as im using aws elastic search service)

    var httpConnection = new AwsHttpConnection();

    var pool = new SingleNodeConnectionPool(uri);
    var config = new ConnectionSettings(pool, httpConnection).DisableDirectStreaming().PrettyJson();
    var client = new ElasticClient(config);

    var result = client.Indices.Create("Test", x => x
        .Map<ElasticSearchDto>(m => m
            .Properties(ps => ps
                .Text(t => t.Name(n => n.Id))
                .Text(t => t.Name(n => n.ApplicationNumber)))

Also tried auto mapping, nothing work. Getting the following response.

# Request:
# Response:
  "error" : {
    "root_cause" : [
        "type" : "mapper_parsing_exception",
        "reason" : "Root mapping definition has unsupported parameters:  [applicationNumber : {type=text}] [id : {type=text}]"
    "type" : "mapper_parsing_exception",
    "reason" : "Failed to parse mapping [properties]: Root mapping definition has unsupported parameters:  [applicationNumber : {type=text}] [id : {type=text}]",
    "caused_by" : {
      "type" : "mapper_parsing_exception",
      "reason" : "Root mapping definition has unsupported parameters:  [applicationNumber : {type=text}] [id : {type=text}]"
  "status" : 400

I will really appreciate some help on this.

Kind regards,


NEST 7.6.1 is compatible with Elasticsearch 7.x.

What version of Elasticsearch are you using? It sounds like you might be using a version older than 7.x, based on the error message.

You are absolutely right. I was using an older version of local stack that was not spinning up with Elastic search version 7.x. Hence the issue. I updated my local stack. Thank you so much for your help

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.