[source, ruby]
----
response = client.indices.put_settings(
  body: {
    'index.max_result_window' => 5000
  }
)
puts response

response = client.cluster.put_settings(
  body: {
    persistent: {
      'search.max_buckets' => 20_000,
      'search.allow_expensive_queries' => false
    }
  }
)
puts response
----
