Elastic command as CURL


(Bradley Baysinger) #1

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
}


(Mark Walkom) #2

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


(Bradley Baysinger) #3

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}


(Mark Walkom) #4

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


(Bradley Baysinger) #5

Ok, this worked:

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

Thanks!


(system) #6

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