public void CreateNewIndexAndMappingForNestedArrayOfChild() { var mappingTestsParent = new MappingTestsParentWithArray { Calls = 3, MappingTestsParentId = 3, MappingTestsItemArray = new[] { new MappingTestsChild { Description = "Hello nested", MappingTestsChildId = 6 }, new MappingTestsChild { Description = "Hello nested item in list", MappingTestsChildId = 7 } } }; using ( var context = new ElasticsearchContext(ConnectionString, new ElasticsearchSerializerConfiguration(_elasticsearchMappingResolver))) { context.TraceProvider = new ConsoleTraceProvider(); context.AddUpdateDocument(mappingTestsParent, mappingTestsParent.MappingTestsParentId); context.SaveChangesAndInitMappings(); Thread.Sleep(1500); var doc = context.GetDocument <MappingTestsParentWithArray>(mappingTestsParent.MappingTestsParentId); Assert.NotNull(doc); } }
public void CreateNewIndexAndMappingForNestedArrayOfChild() { var mappingTestsParent = new MappingTestsParentWithArray { Calls = 3, MappingTestsParentId = 3, MappingTestsItemArray = new[] { new MappingTestsChild { Description = "Hello nested", MappingTestsChildId = 6 }, new MappingTestsChild { Description = "Hello nested item in list", MappingTestsChildId = 7 } } }; using ( var context = new ElasticsearchContext(ConnectionString, new ElasticsearchSerializerConfiguration(_elasticsearchMappingResolver))) { context.TraceProvider = new ConsoleTraceProvider(); context.AddUpdateDocument(mappingTestsParent, mappingTestsParent.MappingTestsParentId); context.SaveChangesAndInitMappings(); Thread.Sleep(1500); var doc = context.GetDocument<MappingTestsParentWithArray>(mappingTestsParent.MappingTestsParentId); Assert.IsNotNull(doc); } }