@@ -16,7 +16,7 @@ public MultiGetOperation(string id)
1616 this . Type = typeof ( T ) ;
1717 }
1818 public MultiGetOperation ( long id ) : this ( id . ToString ( CultureInfo . InvariantCulture ) ) { }
19-
19+
2020 Type IMultiGetOperation . ClrType { get { return typeof ( T ) ; } }
2121
2222 public IndexNameMarker Index { get ; set ; }
@@ -27,6 +27,8 @@ public MultiGetOperation(long id) : this(id.ToString(CultureInfo.InvariantCultur
2727
2828 public IList < PropertyPathMarker > Fields { get ; set ; }
2929
30+ public ISourceFilter Source { get ; set ; }
31+
3032 public string Routing { get ; set ; }
3133 }
3234
@@ -39,6 +41,7 @@ public class MultiGetOperationDescriptor<T> : IMultiGetOperation
3941 TypeNameMarker IMultiGetOperation . Type { get ; set ; }
4042 string IMultiGetOperation . Id { get ; set ; }
4143 string IMultiGetOperation . Routing { get ; set ; }
44+ ISourceFilter IMultiGetOperation . Source { get ; set ; }
4245 IList < PropertyPathMarker > IMultiGetOperation . Fields { get ; set ; }
4346 Type IMultiGetOperation . ClrType { get { return typeof ( T ) ; } }
4447
@@ -83,23 +86,20 @@ public MultiGetOperationDescriptor<T> Type(string type)
8386 }
8487
8588 /// <summary>
86- /// Manually set the type of which a typename will be inferred
89+ /// Control how the document's source is loaded
8790 /// </summary>
88- public MultiGetOperationDescriptor < T > Type ( Type type )
91+ public MultiGetOperationDescriptor < T > Source ( ISourceFilter source )
8992 {
90- if ( type == null ) return this ;
91- Self . Type = type ;
93+ Self . Source = source ;
9294 return this ;
9395 }
9496
95- public MultiGetOperationDescriptor < T > Id ( long id )
96- {
97- return this . Id ( id . ToString ( CultureInfo . InvariantCulture ) ) ;
98- }
99-
100- public MultiGetOperationDescriptor < T > Id ( string id )
97+ /// <summary>
98+ /// Control how the document's source is loaded
99+ /// </summary>
100+ public MultiGetOperationDescriptor < T > Source ( Func < SearchSourceDescriptor < T > , SearchSourceDescriptor < T > > source )
101101 {
102- Self . Id = id ;
102+ Self . Source = source ( new SearchSourceDescriptor < T > ( ) ) ;
103103 return this ;
104104 }
105105
0 commit comments