Elastic command as CURL

How would this be written as CURL? I've tried a few things, but it didn't work.

PUT my_index/_settings
{
"index.mapping.total_fields.limit": 2000
}

curl -XPUT $HOST:9200/my_index/_settings -d '{ "index.mapping.total_fields.limit": 2000 }' most likely.

1 Like

I tried curl -XPUT localhost:9200/my_index/_settings -d '{ "index.mapping.total_fields.limit": 2000 }'

and got

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

Ahh, probably https://www.elastic.co/guide/en/elasticsearch/reference/6.2/common-options.html#_content_type_requirements then.

Ok, this worked:

curl -H 'Content-Type: application/json' -XPUT localhost:9200/my_index/_settings -d '{ "index.mapping.total_fields.limit": 2000 }'

Thanks!

1 Like

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