using System.Collections.Generic;
private static void Main(string[] args)
UpdateData("AU-y5nyZFx8jUFVgexyv");
private static void UpdateData(string docId)
var client = new ElasticClient(new ConnectionSettings(new Uri("http://localhost:9200"), "so32479099"));
dynamic updateDoc = new System.Dynamic.ExpandoObject();
updateDoc.person = Build3Persons();
client.Update<People, object>(
u => u.Id(docId).Doc(new {person = Build3Persons()}).Refresh());
Console.WriteLine(result.ServerError);
private static void LoadData()
var client = new ElasticClient(new ConnectionSettings(new Uri("http://localhost:9200"), "so32479099"));
colors = new List<string> { "red", "green" },
client.Index<People>(people);
public static List<Person> Build2Persons()
var persons = new List<Person>(2);
persons.Add(new Person { name = "john", eyes = "blue", age = "27" });
persons.Add(new Person { name = "mary", eyes = "green", age = "19" });
public static List<Person> Build3Persons()
var persons = new List<Person>(3);
persons.Add(new Person { name = "john", eyes = "blue", age = "27" });
persons.Add(new Person { name = "mary", eyes = "green", age = "19" });
persons.Add(new Person { name = "jane", eyes = "grey", age = "30" });
public List<string> colors { get; set; }
public string place { get; set; }
public List<Person> person { get; set; }
public string name { get; set; }
public string age { get; set; }
public string eyes { get; set; }