internal void OpenIndex(PipelineContext ctx, ESIndexDefinition index) { if (index.IsOpen) { return; } ESHelper.SetLogging(ctx, Connection); ESIndexCmd._CheckIndexFlags flags = ESIndexCmd._CheckIndexFlags.AppendDate; if (ReadOnly) { flags |= ESIndexCmd._CheckIndexFlags.DontCreate; } if ((ctx.ImportFlags & _ImportFlags.ImportFull) != 0) { flags |= ESIndexCmd._CheckIndexFlags.ForceCreate; } index.Create(Connection, flags); WaitForStatus(); var adminEp = this.GetAdminEndpoint(ctx); if (adminEp != null) { int oldCount = ctx.RunAdministrations.Count; ctx.RunAdministrations.Merge(adminEp.LoadAdministration(ctx)); if (ctx.RunAdministrations.Count != oldCount) { ctx.ImportLog.Log("-- merged {0} run-administrations from endpoint {1}. Now contains {2} runs.", ctx.RunAdministrations.Count - oldCount, this.Name, ctx.RunAdministrations.Count); } } }