コード例 #1
0
        public void CreateNewIndexAndMappingForNestedNullArrayOfChild()
        {
            var mappingTestsParent = new MappingTestsParentWithArrayNull
            {
                Calls = 3,
                MappingTestsParentId = 3
            };

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

                Assert.NotNull(doc);
            }
        }
コード例 #2
0
        public void CreateNewIndexAndMappingForNestedNullArrayOfChild()
        {
            var mappingTestsParent = new MappingTestsParentWithArrayNull
            {
                Calls = 3,
                MappingTestsParentId = 3
            };

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

                Assert.IsNotNull(doc);
            }
        }