当前位置: 首页>>代码示例>>C#>>正文


C# DocumentStore.ExecuteIndex方法代码示例

本文整理汇总了C#中Raven.Client.Document.DocumentStore.ExecuteIndex方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentStore.ExecuteIndex方法的具体用法?C# DocumentStore.ExecuteIndex怎么用?C# DocumentStore.ExecuteIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Raven.Client.Document.DocumentStore的用法示例。


在下文中一共展示了DocumentStore.ExecuteIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateDatabaseWithReplication

 private static void CreateDatabaseWithReplication(string databaseName, IDocumentStore store)
 {
     store.DatabaseCommands.GlobalAdmin.CreateDatabase(new DatabaseDocument
     {
         Id = databaseName,
         Settings = new Dictionary<string, string>
         {
             {
                 "Raven/ActiveBundles", "Replication"
             },
             {
                 "Raven/DataDir", "~/" + databaseName
             }
         }
     });
     using (var newStore = new DocumentStore
     {
         Url = store.Url,
         DefaultDatabase = databaseName
     }.Initialize())
     {
         newStore.ExecuteIndex(new RavenDocumentsByEntityName());
     }
 }
开发者ID:myarichuk,项目名称:ReplicationDemos,代码行数:24,代码来源:Program.cs

示例2: Main

        static void Main(string[] args)
        {
            var store = new DocumentStore
            {
                Url = (args.Length == 1 ? args[0] : "http://localhost:33333/storage"),
            };

            store.Initialize();
            store.Conventions.MaxNumberOfRequestsPerSession = 2048;

            Console.WriteLine("This tool is going to examine ServiceControl for potential messages affected by issue  https://github.com/Particular/ServiceControl/pull/558\n");
            
            Console.WriteLine("Creating Temp Index (this may take some time)...");

            var index = new MessageHistories();

            try
            {
                store.ExecuteIndex(index);

                while (store.DatabaseCommands.GetStatistics().StaleIndexes.Length != 0)
                {
                    Thread.Sleep(10);
                }

                Console.WriteLine(" DONE");
                Console.WriteLine("\nScanning for messages that were sent for reprocessing and require your attention.\n");

                var dangerLevel = CheckForMessagesAffectedByIssue(store);

                var noralColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.Cyan;

                switch (dangerLevel)
                {
                    case 0: // Not affected
                        Console.WriteLine("You are NOT affected by issue https://github.com/Particular/ServiceControl/pull/558");
                        Console.WriteLine("However, we ask all users of ServiceControl using 1.6.x to update to the latest version immediately.");
                        Console.WriteLine("Latest release:  https://github.com/Particular/ServiceControl/releases");
                        break;
                    case 1: // Maybe affected
                        Console.WriteLine("You may be affected by issue https://github.com/Particular/ServiceControl/pull/558");
                        Console.WriteLine("Please upgrade ServiceControl to the latest version immediately.");
                        Console.WriteLine("Latest release:  https://github.com/Particular/ServiceControl/releases");
                        Console.WriteLine("Contact us via support (http://particular.net/support) and we will work with you to get your situation sorted out.");
                        break;
                    case 2: // Definitely affected
                        Console.WriteLine("You are affected by issue https://github.com/Particular/ServiceControl/pull/558");
                        Console.WriteLine("Please upgrade ServiceControl to the latest version immediately.");
                        Console.WriteLine("Latest release:  https://github.com/Particular/ServiceControl/releases");
                        Console.WriteLine("Contact us via support (http://particular.net/support) and we will work with you to get your situation sorted out.");
                        break;
                }

                Console.ForegroundColor = noralColor;
            }
            finally
            {
                Console.WriteLine("\nRemoving Temp Index...");
                Console.WriteLine(" DONE");
                store.DatabaseCommands.DeleteIndex(index.IndexName);
            }
        }
开发者ID:Particular,项目名称:ServiceControl.Issue558Detector,代码行数:63,代码来源:Program.cs


注:本文中的Raven.Client.Document.DocumentStore.ExecuteIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。