Skip to content

Commit af72fb1

Browse files
committed
Merge pull request #298 from jakobra/multi-get-overloads
Add support to MultiGet to just have ids and indexName as params
2 parents 5ff01d8 + 4ad6474 commit af72fb1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Diff for: src/Nest/ElasticClient-MultiGet.cs

+18
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,24 @@ public IEnumerable<T> MultiGet<T>(IEnumerable<string> ids)
3131
return this.MultiGet<T>(ids, this.PathResolver.CreateIndexTypePath(index, typeName));
3232
}
3333
/// <summary>
34+
/// Gets multiple documents of T by id in the specified index
35+
/// </summary>
36+
public IEnumerable<T> MultiGet<T>(string index, IEnumerable<int> ids)
37+
where T : class
38+
{
39+
return this.MultiGet<T>(index, ids.Select(i => Convert.ToString(i)));
40+
}
41+
/// <summary>
42+
/// Gets multiple documents of T by id in the specified index
43+
/// </summary>
44+
public IEnumerable<T> MultiGet<T>(string index, IEnumerable<string> ids)
45+
where T : class
46+
{
47+
var typeName = this.GetTypeNameFor<T>();
48+
49+
return this.MultiGet<T>(ids, this.PathResolver.CreateIndexTypePath(index, typeName));
50+
}
51+
/// <summary>
3452
/// Gets multiple documents of T by id in the specified index and the specified typename for T
3553
/// </summary>
3654
public IEnumerable<T> MultiGet<T>(string index, string type, IEnumerable<int> ids)

0 commit comments

Comments
 (0)