public void CreateNewIndexAndMappingForNestedChild() { var mappingTestsParent = new MappingTestsParent { Calls = 3, MappingTestsParentId = 2, MappingTestsItem = new MappingTestsChild { Description = "Hello nested", MappingTestsChildId = 5 } }; 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 <MappingTestsParent>(mappingTestsParent.MappingTestsParentId); Assert.NotNull(doc); } }
private static MappingTestsParent SetupIndexMappingTests(string index, out IElasticsearchMappingResolver elasticsearchMappingResolver) { var mappingTestsParent = new MappingTestsParent { Calls = 3, MappingTestsParentId = 2, MappingTestsItem = new MappingTestsChild { Description = "Hello nested", MappingTestsChildId = 5 } }; elasticsearchMappingResolver = new ElasticsearchMappingResolver(); elasticsearchMappingResolver.AddElasticSearchMappingForEntityType(typeof(MappingTestsParent), MappingUtils.GetElasticsearchMapping(index)); return(mappingTestsParent); }
public void CreateNewIndexAndMappingForNestedChild() { var mappingTestsParent = new MappingTestsParent { Calls = 3, MappingTestsParentId = 2, MappingTestsItem = new MappingTestsChild { Description = "Hello nested", MappingTestsChildId = 5 } }; 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<MappingTestsParent>(mappingTestsParent.MappingTestsParentId); Assert.IsNotNull(doc); } }
private static MappingTestsParent SetupIndexMappingTests(string index, out IElasticsearchMappingResolver elasticsearchMappingResolver) { var mappingTestsParent = new MappingTestsParent { Calls = 3, MappingTestsParentId = 2, MappingTestsItem = new MappingTestsChild { Description = "Hello nested", MappingTestsChildId = 5 } }; elasticsearchMappingResolver = new ElasticsearchMappingResolver(); elasticsearchMappingResolver.AddElasticSearchMappingForEntityType(typeof (MappingTestsParent), MappingUtils.GetElasticsearchMapping(index)); return mappingTestsParent; }