Hi,
With the latest changes from the ELK 6.1.1 on the Removal of Mapping types, my ruby code doesn't work to create the mapping. Could you please let me know if I am doing anything wrong the mapping created in json file.
Below is the code snippet:
require 'rest_client'
require 'json'
def create_mapping
file = File.read('test.json')
RestClient.put 'http://localhost:9200/testing', file
end
test.json consists as below:
{
"mappings": {
"features": {
"properties": {
"@timestamp": {
"type": "date",
"format": "dateOptionalTime"
},
"build_number": {
"type": "integer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"job_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
The same mapping works fine on the Kibana dev tools with the PUT method, but doesn't work with the Ruby client.
The error message returned from ruby rest client is "406 Not Acceptable (RestClient::NotAcceptable)"
Could you please let me know how do I fix this issue. Thanks !