diff --git a/new_docs/contents/elasticsearch-net/cluster-failover.md b/new_docs/contents/elasticsearch-net/cluster-failover.md index 07f9657df8f..4ffc6ad58a8 100644 --- a/new_docs/contents/elasticsearch-net/cluster-failover.md +++ b/new_docs/contents/elasticsearch-net/cluster-failover.md @@ -23,10 +23,10 @@ Configuring how the registered `IConnectionPool` should behave happens on the `I #### SniffOnConnectionFault() Should the connection pool resniff the cluster state everytime an operation on a node throws an exception or a faulty http status code. -Defaults to false. +Defaults to true. #### SniffOnStartup() -Should the connection pool sniff the cluster state the first time its instantiated. Defaults to false. +Should the connection pool sniff the cluster state the first time its instantiated. Defaults to true. #### SniffLifeSpan() When set will cause the connectionpool to resniff whenever it notices the last sniff information happened too long ago. Defaults to null. diff --git a/new_docs/contents/nest/cluster/nodes-stats.markdown b/new_docs/contents/nest/cluster/nodes-stats.markdown index 64dec16452b..fe5596ec5e7 100644 --- a/new_docs/contents/nest/cluster/nodes-stats.markdown +++ b/new_docs/contents/nest/cluster/nodes-stats.markdown @@ -8,11 +8,10 @@ menuitem: nodes-stats # Nodes stats -var r = this._client.NodeInfo(NodesInfo.All); - - var node = r.Nodes.First(); + var r = this._client.NodeInfo(NodesInfo.All); + var node = r.Nodes.First(); You can than traverse the node info objects i.e: - node.Value.OS.Cpu.CacheSizeInBytes; + node.Value.OS.Cpu.CacheSizeInBytes; diff --git a/new_docs/contents/nest/cluster/state.markdown b/new_docs/contents/nest/cluster/state.markdown index 99f35da70a5..f2f8d6a6f03 100644 --- a/new_docs/contents/nest/cluster/state.markdown +++ b/new_docs/contents/nest/cluster/state.markdown @@ -8,5 +8,17 @@ menuitem: state # Cluster state -cluster state has not yet been mapped +## Get state +To get the basic cluster state, call: + + var state = _client.ClusterState(); + +This returns a IClusterStateResponse that contains information about the master node, all nodes in the cluster and such. + +## Get specific part of state + +If you only want a specific part, i.e. only information about nodes, you can do the following: + + var state = _client.ClusterState(c => c + .Metrics(ClusterStateMetric.Nodes)); diff --git a/new_docs/contents/nest/indices/aliases.markdown b/new_docs/contents/nest/indices/aliases.markdown index a13677b19ad..93a459f181a 100644 --- a/new_docs/contents/nest/indices/aliases.markdown +++ b/new_docs/contents/nest/indices/aliases.markdown @@ -8,16 +8,37 @@ menuitem: aliases #Aliasing +Adding/removing and updating aliases are also easy to do in NEST. For more information look at the [Alias Doc](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) + ## Adding - var response = this.ConnectedClient.Alias("nest_test_data", "nest_test_data2"); + _client.Alias(a => a + .Add(add => add + .Index("myindex") + .Alias("myalias"))); + +## Removing + + _client.Alias(a => a + .Remove(remove => remove + .Index("myindex") + .Alias("myalias"))); ## Renaming - var response = this.ConnectedClient.Rename("nest_test_data", "nest_test_data2", "nest_test_data3"); +To rename a alias, just do an Add and a Remove in the same operation. Elasticsearch will then atomically rename your alias + _client.Alias(a => a + .Add(add => add + .Index("myindex") + .Alias("newalias")) + .Remove(remove => remove + .Index("myindex") + .Alias("oldalias"))); -## Removing +## Asynchronous + +Doing alias operations Async is simple: - var response = this.ConnectedClient.RemoveAlias("nest_test_data", "nest_test_data3"); + _client.AliasAsync(...);