@@ -6,86 +6,104 @@ public interface IReindexRequest
66 {
77 IndexName To { get ; set ; }
88 IndexName From { get ; set ; }
9- Types Type { get ; set ; }
9+ Types Types { get ; set ; }
10+ /// <summary>
11+ /// A search request can be scrolled by specifying the scroll parameter. The scroll parameter is a time value
12+ /// parameter (for example: scroll=5m), indicating for how long the nodes that participate in the search
13+ /// will maintain relevant resources in order to continue and support it. This is very similar in its idea to opening a cursor against a database.
14+ /// </summary>
1015 Time Scroll { get ; set ; }
16+
17+ /// <summary>
18+ /// The number of hits to return. Defaults to 100. When using scroll search type,
19+ /// size is actually multiplied by the number of shards!
20+ /// </summary>
1121 int ? Size { get ; set ; }
1222
23+ /// <summary>
24+ /// A query to optionally limit the documents to use for the reindex operation.
25+ /// </summary>
1326 QueryContainer Query { get ; set ; }
1427
15- ICreateIndexRequest CreateIndexRequest { get ; set ; }
28+ /// <summary>
29+ /// Do not send a create index call on <see cref="To"/>, assume the index has been created outside of the reindex.
30+ /// </summary>
31+ bool OmitIndexCreation { get ; set ; }
1632
17- IPutMappingRequest PutMappingRequest { get ; set ; }
33+ /// <summary>
34+ /// Describe how the newly created index should be created. Remember you can also register Index Templates for more dynamic usecases.
35+ /// </summary>
36+ ICreateIndexRequest CreateIndexRequest { get ; set ; }
1837 }
1938
2039 public class ReindexRequest : IReindexRequest
2140 {
41+ /// <inheritdoc/>
42+ public bool OmitCreateIndex { get ; set ; }
43+ /// <inheritdoc/>
2244 public IndexName To { get ; set ; }
45+ /// <inheritdoc/>
2346 public IndexName From { get ; set ; }
24- public Types Type { get ; set ; }
47+ /// <inheritdoc/>
48+ public Types Types { get ; set ; }
49+ /// <inheritdoc/>
2550 public Time Scroll { get ; set ; }
51+ /// <inheritdoc/>
2652 public int ? Size { get ; set ; }
53+ /// <inheritdoc/>
2754 public QueryContainer Query { get ; set ; }
55+ /// <inheritdoc/>
2856 public ICreateIndexRequest CreateIndexRequest { get ; set ; }
29- public IPutMappingRequest PutMappingRequest { get ; set ; }
30- public ReindexRequest ( IndexName from , IndexName to , Types type )
57+
58+ public ReindexRequest ( IndexName from , IndexName to , Types types )
3159 {
3260 this . To = to ;
3361 this . From = from ;
34- this . Type = type ;
62+ this . Types = types ;
3563 }
3664 }
3765
3866 public class ReindexDescriptor < T > : DescriptorBase < ReindexDescriptor < T > , IReindexRequest > , IReindexRequest where T : class
3967 {
68+ bool IReindexRequest . OmitIndexCreation { get ; set ; }
4069 IndexName IReindexRequest . To { get ; set ; }
4170 IndexName IReindexRequest . From { get ; set ; }
42- Types IReindexRequest . Type { get ; set ; }
71+ Types IReindexRequest . Types { get ; set ; }
4372 Time IReindexRequest . Scroll { get ; set ; }
4473 int ? IReindexRequest . Size { get ; set ; }
4574 QueryContainer IReindexRequest . Query { get ; set ; }
4675 ICreateIndexRequest IReindexRequest . CreateIndexRequest { get ; set ; }
47- IPutMappingRequest IReindexRequest . PutMappingRequest { get ; set ; }
4876
4977 public ReindexDescriptor ( IndexName from , IndexName to )
5078 {
5179 Assign ( a => a . From = from )
5280 . Assign ( a => a . To = to )
53- . Assign ( a => a . Type = typeof ( T ) ) ;
81+ . Assign ( a => a . Types = typeof ( T ) ) ;
5482 }
5583
56- /// <summary>
57- /// A search request can be scrolled by specifying the scroll parameter. The scroll parameter is a time value parameter (for example: scroll=5m), indicating for how long the nodes that participate in the search will maintain relevant resources in order to continue and support it. This is very similar in its idea to opening a cursor against a database.
58- /// </summary>
59- /// <param name="scrollTime">The scroll parameter is a time value parameter (for example: scroll=5m)</param>
60- /// <returns></returns>
84+ /// <inheritdoc/>
6185 public ReindexDescriptor < T > Scroll ( Time scrollTime ) => Assign ( a => a . Scroll = scrollTime ) ;
6286
63- /// <summary>
64- /// The number of hits to return. Defaults to 100. When using scroll search type,
65- /// size is actually multiplied by the number of shards!
66- /// </summary>
87+ /// <inheritdoc/>
6788 public ReindexDescriptor < T > Size ( int ? size ) => Assign ( a => a . Size = size ) ;
6889
69- /// <summary>
70- /// The number of hits to return. Defaults to 100.
71- /// </summary>
90+ /// <inheritdoc/>
7291 public ReindexDescriptor < T > Take ( int ? take ) => Assign ( a => a . Size = take ) ;
7392
74- /// <summary>
75- /// A query to optionally limit the documents to use for the reindex operation.
76- /// </summary>
93+ /// <inheritdoc/>
94+ public ReindexDescriptor < T > OmitIndexCreation ( bool omit = true ) => Assign ( a => a . OmitIndexCreation = true ) ;
95+
96+ /// <inheritdoc/>
7797 public ReindexDescriptor < T > Query ( Func < QueryContainerDescriptor < T > , QueryContainer > querySelector ) =>
7898 Assign ( a => a . Query = querySelector ? . Invoke ( new QueryContainerDescriptor < T > ( ) ) ) ;
7999
80- /// <summary>
81- /// A query to optionally limit the documents to use for the reindex operation.
82- /// </summary>
100+ /// <inheritdoc/>
83101 public ReindexDescriptor < T > Query ( QueryContainer query ) => Assign ( a => a . Query = query ) ;
84102
85103 /// <summary>
86104 /// Specify the document types to reindex. By default, will be <typeparamref name="T"/>
87105 /// </summary>
88- public ReindexDescriptor < T > Type ( Types type ) => Assign ( a => a . Type = type ) ;
106+ public ReindexDescriptor < T > Type ( Types type ) => Assign ( a => a . Types = type ) ;
89107
90108 /// <summary>
91109 /// Reindex all document types.
0 commit comments