/// <summary> /// 创建Idx,并设置分片和副本 /// </summary> public void Settings() { var response = client.CreateIndex("test01", e => e.Settings(s => s.NumberOfReplicas(3).Setting("number_of_shards", 3))); Console.WriteLine(JsonConvert.SerializeObject(response)); } /// <summary> /// 更新settings /// </summary> public void UpdateSettings() { var response = client.UpdateIndexSettings("test01", x => x.IndexSettings(s => s.Setting("number_of_replicas", 2))); Console.WriteLine(JsonConvert.SerializeObject(response)); } /// <summary> /// CatHealth /// </summary> public void CatHealth() { var response = client.CatHealth(e => e.Pretty()); Console.WriteLine(JsonConvert.SerializeObject(response)); } /// <summary> /// ClusterHealth /// </summary> public void ClusterHealth() { var response = client.ClusterHealth(e => e.Pretty()); Console.WriteLine(JsonConvert.SerializeObject(response)); } /// <summary> /// 查看setting /// </summary> public void GetIndexSettings() { var response = client.GetIndexSettings(x => x.Index("test01").Pretty()); Console.WriteLine(JsonConvert.SerializeObject(response)); }