Exemple #1
0
        public void can_index_collections_larger_than_32768()
        {
            using (var store = GetDocumentStore())
            {
                using (var bulk = store.BulkInsert())
                {
                    for (var i = 0; i < 40000; i++)
                    {
                        bulk.Store(new Order {
                            CompanyId = i.ToString()
                        });
                    }
                }

                //wait for indexing of Raven/DocumentsByEntityName
                WaitForIndexing(store);

                var index = new Orders_Index();
                index.Execute(store);

                WaitForIndexing(store);

                Assert.Equal(40000, WaitForEntriesCount(store, index.IndexName, 40000));
            }
        }
Exemple #2
0
        public void can_index_collections_larger_than_32768()
        {
            using (var store = GetDocumentStore())
            {
                using (var bulk = store.BulkInsert())
                {
                    for (var i = 0; i < 40000; i++)
                    {
                        bulk.Store(new Order {
                            CompanyId = i.ToString()
                        });
                    }
                }

                //wait for indexing of Raven/DocumentsByEntityName
                WaitForIndexing(store);

                var index = new Orders_Index();
                index.Execute(store);

                WaitForIndexing(store);

                var stats = store.Maintenance.Send(new GetIndexStatisticsOperation(index.IndexName));
                Assert.Equal(40000, stats.EntriesCount);
            }
        }
Exemple #3
0
        public void can_index_collections_larger_than_predefined()
        {
            using (var store = NewDocumentStore(configureStore: documentStore =>
            {
                documentStore.Configuration.MaxPrecomputedBatchSizeForNewIndex = 10000;
            }))
            {
                using (var bulk = store.BulkInsert())
                {
                    for (var i = 0; i < 10500; i++)
                    {
                        bulk.Store(new Order {
                            CompanyId = i.ToString()
                        });
                    }
                }

                //wait for indexing of Raven/DocumentsByEntityName
                WaitForIndexing(store);

                var index = new Orders_Index();
                index.Execute(store);

                WaitForIndexing(store);

                var stats       = store.DatabaseCommands.GetStatistics();
                var ordersIndex = stats.Indexes.First(x => x.ForEntityName.Contains("Orders"));
                Assert.Equal(10500, ordersIndex.DocsCount);
            }
        }
Exemple #4
0
        public void can_index_collections_smaller_than_32768()
        {
            using (var store = NewDocumentStore())
            {
                using (var bulk = store.BulkInsert())
                {
                    for (var i = 0; i < 30000; i++)
                    {
                        bulk.Store(new Order {
                            CompanyId = i.ToString()
                        });
                    }
                }

                //wait for indexing of Raven/DocumentsByEntityName
                WaitForIndexing(store);

                var index = new Orders_Index();
                index.Execute(store);

                WaitForIndexing(store);

                var stats       = store.DatabaseCommands.GetStatistics();
                var ordersIndex = stats.Indexes.First(x => x.ForEntityName.Contains("Orders"));
                Assert.Equal(30000, ordersIndex.DocsCount);
            }
        }
Exemple #5
0
        public void can_disable_precomputed_batch()
        {
            using (var store = NewDocumentStore(configureStore: documentStore =>
            {
                documentStore.Configuration.MaxPrecomputedBatchSizeForNewIndex = 0;
            }))
            {
                using (var session = store.OpenSession())
                {
                    session.Store(new Order {
                        CompanyId = "companies/1"
                    });
                    session.SaveChanges();
                }

                var index = new Orders_Index();
                index.Execute(store);

                WaitForIndexing(store);
            }
        }
Exemple #6
0
        public void can_index_collections_smaller_than_32768()
        {
            using (var store = GetDocumentStore())
            {
                using (var bulk = store.BulkInsert())
                {
                    for (var i = 0; i < 30000; i++)
                    {
                        bulk.Store(new Order {
                            CompanyId = i.ToString()
                        });
                    }
                }

                var index = new Orders_Index();
                index.Execute(store);

                WaitForIndexing(store);

                Assert.Equal(30000, WaitForEntriesCount(store, index.IndexName, 30000));
            }
        }
Exemple #7
0
        public void can_index_collections_smaller_than_32768()
        {
            using (var store = GetDocumentStore())
            {
                using (var bulk = store.BulkInsert())
                {
                    for (var i = 0; i < 30000; i++)
                    {
                        bulk.Store(new Order {
                            CompanyId = i.ToString()
                        });
                    }
                }

                var index = new Orders_Index();
                index.Execute(store);

                WaitForIndexing(store);

                var stats = store.Admin.Send(new GetIndexStatisticsOperation(index.IndexName));
                Assert.Equal(30000, stats.EntriesCount);
            }
        }