private async Task CheckJson(JToken v, DocumentModel model, params string[] keys) { if (v.Type == JTokenType.String) { var path = keys.Aggregate(Path, (current, k) => current + $"{k}."); var dict = await _indexer.AddDocuments(model, 0, keys); Dictionary.Add(new KeyValuePair <string, Dictionary <string, Guid> >(path, dict)); } else if (v.Type == JTokenType.Object) { var o = v.ToObject <JObject>(); await CreateIndexes(o, model, keys); } else if (v.Type == JTokenType.Array) { var tmp = (JArray)v; for (var i = 0; i < tmp.Count; i++) { var path = Path; foreach (var key in keys) { path += key + "."; } path += $"{i}"; var dict = await _indexer.AddDocuments(model, i, keys); Dictionary.Add(new KeyValuePair <string, Dictionary <string, Guid> >(path, dict)); } } else { var path = keys.Aggregate(Path, (current, k) => current + $"{k}"); var dict = await _indexer.AddDocuments(model, 0, keys); Dictionary.Add(new KeyValuePair <string, Dictionary <string, Guid> >(path, dict)); } }