Exemplo n.º 1
0
        public void CreateNewIndexAndMappingForNullNestedChild()
        {
            var mappingTestsParent = new MappingTestsParentNull
            {
                Calls = 3,
                MappingTestsParentId = 2
            };

            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 <MappingTestsParentNull>(mappingTestsParent.MappingTestsParentId);

                Assert.NotNull(doc);
            }
        }
Exemplo n.º 2
0
        public void CreateNewIndexAndMappingForNullNestedChild()
        {
            var mappingTestsParent = new MappingTestsParentNull
            {
                Calls = 3,
                MappingTestsParentId = 2
            };

            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<MappingTestsParentNull>(mappingTestsParent.MappingTestsParentId);

                Assert.IsNotNull(doc);
            }
        }