1
votes

Hi !

I migrated from ES 5 to ES 6, and I've tried to push the following mapping with curl as usual:

"mappings" : {
"mee": {
    "properties" : {
        "ind1" : { "type" : "float" },
        "ind2" : { "type" : "float" },
        "ind3" : { "type" : "float" },
        "time" : { "type" : "date", "format" : "HH:mm:ss" },
        "name" : { "type" : "string" },
        "timestamp" : { "type" : "date", "format" : "yyyy-MM-dd HH:mm:ss" },
    }
}

With the following command:

$ curl -XPUT "http://localhost:9200/mee/" -d @config/ESConf/ESUpdate.conf

{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

And as an header was necessary (as per required by ES 6) I've made the following:

$ curl -XPUT "http://localhost:9200/mee/" -H 'Content-Type: application/json' -d @config/ESConf/ESUpdate.conf

{"error":{"root_cause":[{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}],"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"},"status":500}

And now I am completely lost... I just don't understand this error... Did I made something wrong ?

Thank you !

1

1 Answers

1
votes

There is something wrong with the syntax of your mapping. Enclose the whole mapping definition into curly brackets and ensure brackets pairing. Also remove redundant comma after the last property. Here is slightly formatted example of correct request body:

{
  "mappings": {
    "mee": {
      "properties": {
        "ind1": {
          "type": "float"
        },
        "ind2": {
          "type": "float"
        },
        "ind3": {
          "type": "float"
        },
        "time": {
          "type": "date",
          "format": "HH:mm:ss"
        },
        "name": {
          "type": "string"
        },
        "timestamp": {
          "type": "date",
          "format": "yyyy-MM-dd HH:mm:ss"
        }
      }
    }
  }
}