@@ -24,17 +24,16 @@ public static class SourceManyExtensions
24
24
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
25
25
/// <param name="client"></param>
26
26
/// <param name="ids">A list of ids as string</param>
27
- /// <param name="index">Optionally override the default inferred indexname for T </param>
28
- /// <param name="type">Optionally override the default inferred indexname for T </param>
27
+ /// <param name="index">Set the request level index name </param>
28
+ /// <param name="type">Set the request level type name </param>
29
29
public static IEnumerable < T > SourceMany < T > ( this IElasticClient client , IEnumerable < string > ids , string index = null , string type = null )
30
30
where T : class
31
31
{
32
32
var result = client . MultiGet ( s => s
33
+ . Index ( index )
34
+ . Type ( type )
33
35
. RequestConfiguration ( r => r . ThrowExceptions ( ) )
34
- . GetMany < T > ( ids , ( gs , i ) => gs
35
- . Index ( index )
36
- . Type ( type )
37
- )
36
+ . GetMany < T > ( ids )
38
37
) ;
39
38
return result . SourceMany < T > ( ids ) ;
40
39
}
@@ -52,8 +51,8 @@ public static IEnumerable<T> SourceMany<T>(this IElasticClient client, IEnumerab
52
51
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
53
52
/// <param name="client"></param>
54
53
/// <param name="ids">A list of ids as int</param>
55
- /// <param name="index">Optionally override the default inferred indexname for T </param>
56
- /// <param name="type">Optionally override the default inferred indexname for T </param>
54
+ /// <param name="index">Set the request level index name </param>
55
+ /// <param name="type">Set the request level type name </param>
57
56
public static IEnumerable < T > SourceMany < T > ( this IElasticClient client , IEnumerable < long > ids , string index = null , string type = null )
58
57
where T : class => client . SourceMany < T > ( ids . Select ( i => i . ToString ( CultureInfo . InvariantCulture ) ) , index , type ) ;
59
58
@@ -70,20 +69,19 @@ public static IEnumerable<T> SourceMany<T>(this IElasticClient client, IEnumerab
70
69
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
71
70
/// <param name="client"></param>
72
71
/// <param name="ids">A list of ids as string</param>
73
- /// <param name="index">Optionally override the default inferred indexname for T </param>
74
- /// <param name="type">Optionally override the default inferred indexname for T </param>
72
+ /// <param name="index">Set the request level index name </param>
73
+ /// <param name="type">Set the request level type name </param>
75
74
public static async Task < IEnumerable < T > > SourceManyAsync < T > (
76
75
this IElasticClient client , IEnumerable < string > ids , string index = null , string type = null ,
77
76
CancellationToken cancellationToken = default ( CancellationToken )
78
77
)
79
78
where T : class
80
79
{
81
80
var response = await client . MultiGetAsync ( s => s
81
+ . Index ( index )
82
+ . Type ( type )
82
83
. RequestConfiguration ( r => r . ThrowExceptions ( ) )
83
- . GetMany < T > ( ids , ( gs , i ) => gs
84
- . Index ( index )
85
- . Type ( type )
86
- ) , cancellationToken )
84
+ . GetMany < T > ( ids ) , cancellationToken )
87
85
. ConfigureAwait ( false ) ;
88
86
return response . SourceMany < T > ( ids ) ;
89
87
}
@@ -101,8 +99,8 @@ public static async Task<IEnumerable<T>> SourceManyAsync<T>(
101
99
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
102
100
/// <param name="client"></param>
103
101
/// <param name="ids">A list of ids as int</param>
104
- /// <param name="index">Optionally override the default inferred indexname for T </param>
105
- /// <param name="type">Optionally override the default inferred indexname for T </param>
102
+ /// <param name="index">Set the request level index name </param>
103
+ /// <param name="type">Set the request level type name </param>
106
104
public static Task < IEnumerable < T > > SourceManyAsync < T > (
107
105
this IElasticClient client , IEnumerable < long > ids , string index = null , string type = null ,
108
106
CancellationToken cancellationToken = default ( CancellationToken )
0 commit comments