internal SuggestResponse(ShardsMetaData metaData, IDictionary <string, object> dict) { this.Shards = metaData; this.Suggestions = dict .Select(kv => new { k = kv.Key, v = kv.Value as Suggest <T>[] }) .Where(kv => kv.v != null) .ToDictionary(kv => kv.k, kv => kv.v); }
public override IResponse RefreshFromConnection(ElasticClient cli) { var health = cli.Stats(); if (health.IsValid && health.OK) { GlobalStats = health.Stats; ShardsMetaData = health.Shards; Indices = health.Indices; } return health; }
internal SuggestResponse(ShardsMetaData metaData, IDictionary <string, object> dict) { this.Shards = metaData; if (dict == null) { return; } this.Suggestions = dict .Select(kv => new { k = kv.Key, v = kv.Value as Suggest <T>[] }) .Where(kv => kv.v != null) .ToDictionary(kv => kv.k, kv => (IReadOnlyCollection <Suggest <T> >)kv.v); }