Skip to content

Instantly share code, notes, and snippets.

@justinlynn
Created February 7, 2012 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinlynn/1762409 to your computer and use it in GitHub Desktop.
Save justinlynn/1762409 to your computer and use it in GitHub Desktop.
elastic search recipe snippet
elasticsearch_cluster_nodes = search(:node, 'node_elasticsearch_cluster_name:#{node[:elasticsearch][:cluster_name]}')
elasticsearch_cluster_nodes_count = elasticsearch_cluster_nodes.count
elasticsearch_cluster_nodes_quorum = (0.75 * elasticsearch_cluster_nodes_count).to_i
{
:index => {
:number_of_replicas => 5
}
}.to_yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment