Search code examples
ruby-on-railsherokuelasticsearchbonsai-elasticsearch

Bonsai Elasticsearch how to reduce replica


I have two models that I want to use the bonsai elasticsearch with. I created an index for each, and that led me to have total 4 shards(2 primary and 2 replicas). but I don't think I need that much space since, in my website, there is not much data to be indexed yet. What I am trying to do is to reduce or delete replicas so that I only user primary with the two models indexed.

this is what I tried from Bonsai website:

curl -s -XPUT https://user:[email protected]/production -d '{
  "settings": {
    "number_of_replicas":0
}'

for above 'production', I typed my model name instead, and it gives me an error.

{"error":{"root_cause":[{"type":"parse_exception","reason":"failed to parse source"}],"type":"parse_exception","reason":"failed to parse source","caused_by":{"type":"json_parse_exception","reason":"Illegal unquoted character

anyone please tell me what am I missing here?


Solution

  • Try this:

    curl -s -XPUT https://user:[email protected]/production/_settings -d '{"index":{"number_of_replicas":0}}'