public override void LoadModelParameters(string parameters) { var urlParser = new UrlParser(parameters); ExecutionElapsedTime.Value = TimeSpan.Zero; GroupByField.Value = ""; ValueCalculations.Clear(); UpdateAvailableIndexes(); var newIndexName = urlParser.Path.Trim('/'); if (string.IsNullOrEmpty(newIndexName)) { if (AvailableIndexes.Any()) { NavigateToIndexReport(AvailableIndexes.FirstOrDefault()); return; } } IndexName = newIndexName; DatabaseCommands.GetIndexAsync(IndexName) .ContinueOnUIThread(task => { if (task.IsFaulted || task.Result == null) { if (AvailableIndexes.Any()) { NavigateToIndexReport(AvailableIndexes.FirstOrDefault()); } else { NavigateToIndexesList(); } return; } var fields = task.Result.Fields; IndexFields.Match(fields); QueryIndexAutoComplete = new QueryIndexAutoComplete(fields, IndexName, FilterDoc); }).Catch(); }
public AutoMapReduceIndexDefinition(string collection, AutoIndexField[] mapFields, AutoIndexField[] groupByFields) : base(AutoIndexNameFinder.FindMapReduceIndexName(collection, mapFields, groupByFields), collection, mapFields) { GroupByFields = groupByFields.ToDictionary(x => x.Name, x => x, StringComparer.Ordinal); MapAndGroupByFields = new Dictionary <string, AutoIndexField>(MapFields.Count + GroupByFields.Count); foreach (var field in MapFields) { MapAndGroupByFields[field.Key] = field.Value.As <AutoIndexField>(); } foreach (var field in GroupByFields) { MapAndGroupByFields[field.Key] = field.Value; foreach (var indexField in field.Value.ToIndexFields()) { IndexFields.Add(indexField.Name, indexField); } } }
public AutoMapReduceIndexDefinition(string collection, AutoIndexField[] mapFields, AutoIndexField[] groupByFields, IndexDeploymentMode?deploymentMode, long?indexVersion = null) : base(AutoIndexNameFinder.FindMapReduceIndexName(collection, mapFields, groupByFields), collection, mapFields, deploymentMode, indexVersion) { OrderedGroupByFields = groupByFields.OrderBy(x => x.Name, StringComparer.Ordinal).ToArray(); GroupByFields = groupByFields.ToDictionary(x => x.Name, x => x, StringComparer.Ordinal); MapAndGroupByFields = new Dictionary <string, AutoIndexField>(MapFields.Count + GroupByFields.Count); foreach (var field in MapFields) { MapAndGroupByFields[field.Key] = field.Value.As <AutoIndexField>(); } foreach (var field in GroupByFields) { MapAndGroupByFields[field.Key] = field.Value; foreach (var indexField in field.Value.ToIndexFields()) { IndexFields.Add(indexField.Name, indexField); } } }