-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathIElasticClient.cs
1193 lines (1062 loc) · 78.8 KB
/
IElasticClient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Elasticsearch.Net;
using Elasticsearch.Net.Connection;
using Nest.Domain;
namespace Nest
{
public interface IElasticClient
{
IConnection Connection { get; }
INestSerializer Serializer { get; }
IElasticsearchClient Raw { get; }
ElasticInferrer Infer { get; }
/// <summary>
/// Helper method that allows you to reindex from one index into another using SCAN and SCROLL.
/// </summary>
/// <returns>An IObservable you can subscribe to to listen to the progress of the reindexation process</returns>
IObservable<IReindexResponse<T>> Reindex<T>(Func<ReindexDescriptor<T>, ReindexDescriptor<T>> reindexSelector)
where T : class;
/// <summary>
/// A search request can be scrolled by specifying the scroll parameter.
/// <para>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.</para><para>
/// This is very similar in its idea to opening a cursor against a database.</para>
/// <para> </para><para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html</para>
/// </summary>
/// <typeparam name="T">The type that represents the result hits</typeparam>
/// <param name="scrollSelector">A descriptor that describes the scroll operation</param>
/// <returns>A query response holding T hits as well as the ScrollId for the next scroll operation</returns>
ISearchResponse<T> Scroll<T>(Func<ScrollDescriptor<T>, ScrollDescriptor<T>> scrollSelector)
where T : class;
/// <summary>
/// A search request can be scrolled by specifying the scroll parameter.
/// <para>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.</para><para>
/// This is very similar in its idea to opening a cursor against a database.</para>
/// <para> </para><para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html</para>
/// </summary>
/// <typeparam name="T">The type that represents the result hits</typeparam>
/// <param name="scrollSelector">A descriptor that describes the scroll operation</param>
/// <returns>A query response holding T hits as well as the ScrollId for the next scroll operation</returns>
Task<ISearchResponse<T>> ScrollAsync<T>(Func<ScrollDescriptor<T>, ScrollDescriptor<T>> scrollSelector)
where T : class;
/// <summary>
/// The update API allows to update a document based on a script provided.
/// <para>The operation gets the document (collocated with the shard) from the index, runs the script
/// (with optional script language and parameters), and index back the result
/// (also allows to delete, or ignore the operation). </para>
/// <para>It uses versioning to make sure no updates have happened during the "get" and "reindex".</para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html
/// </summary>
/// <typeparam name="T">The type to describe the document to be updated</typeparam>
/// <param name="updateSelector">a descriptor that describes the update operation</param>
IUpdateResponse Update<T>(Func<UpdateDescriptor<T, T>, UpdateDescriptor<T, T>> updateSelector) where T : class;
/// <summary>
/// The update API allows to update a document based on a script provided.
/// <para>The operation gets the document (collocated with the shard) from the index, runs the script
/// (with optional script language and parameters), and index back the result
/// (also allows to delete, or ignore the operation). </para>
/// <para>It uses versioning to make sure no updates have happened during the "get" and "reindex".</para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html
/// </summary>
/// <typeparam name="T">The type to describe the document to be updated</typeparam>
/// <typeparam name="K">The type of the partial update document</typeparam>
/// <param name="updateSelector">a descriptor that describes the update operation</param>
IUpdateResponse Update<T, K>(Func<UpdateDescriptor<T, K>, UpdateDescriptor<T, K>> updateSelector)
where T : class
where K : class;
/// <summary>
/// The update API allows to update a document based on a script provided.
/// <para>The operation gets the document (collocated with the shard) from the index, runs the script
/// (with optional script language and parameters), and index back the result
/// (also allows to delete, or ignore the operation). </para>
/// <para>It uses versioning to make sure no updates have happened during the "get" and "reindex".</para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html
/// </summary>
/// <typeparam name="T">The type to describe the document to be updated</typeparam>
/// <param name="updateSelector">a descriptor that describes the update operation</param>
Task<IUpdateResponse> UpdateAsync<T>(Func<UpdateDescriptor<T, T>, UpdateDescriptor<T, T>> updateSelector)
where T : class;
/// <summary>
/// The update API allows to update a document based on a script provided.
/// <para>The operation gets the document (collocated with the shard) from the index, runs the script
/// (with optional script language and parameters), and index back the result
/// (also allows to delete, or ignore the operation). </para>
/// <para>It uses versioning to make sure no updates have happened during the "get" and "reindex".</para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html
/// </summary>
/// <typeparam name="T">The type to describe the document to be updated</typeparam>
/// <typeparam name="K">The type of the partial update document</typeparam>
/// <param name="updateSelector">a descriptor that describes the update operation</param>
Task<IUpdateResponse> UpdateAsync<T, K>(Func<UpdateDescriptor<T, K>, UpdateDescriptor<T, K>> updateSelector)
where T : class
where K : class;
/// <summary>
/// Change specific index level settings in real time. Note not all index settings CAN be updated.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html
/// </summary>
/// <param name="updateSettingsSelector">A descriptor that strongly types all the updateable settings</param>
IAcknowledgedResponse UpdateSettings( Func<UpdateSettingsDescriptor, UpdateSettingsDescriptor> updateSettingsSelector);
/// <summary>
/// Change specific index level settings in real time. Note not all index settings CAN be updated.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html
/// </summary>
/// <param name="updateSettingsSelector">A descriptor that strongly types all the updateable settings</param>
Task<IAcknowledgedResponse> UpdateSettingsAsync(Func<UpdateSettingsDescriptor, UpdateSettingsDescriptor> updateSettingsSelector);
/// <summary>
/// The validate API allows a user to validate a potentially expensive query without executing it.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-validate.html
/// </summary>
/// <typeparam name="T">The type used to describe the query</typeparam>
/// <param name="querySelector">A descriptor that describes the query operation</param>
IValidateResponse Validate<T>(Func<ValidateQueryDescriptor<T>, ValidateQueryDescriptor<T>> querySelector)
where T : class;
/// <summary>
/// The validate API allows a user to validate a potentially expensive query without executing it.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-validate.html
/// </summary>
/// <typeparam name="T">The type used to describe the query</typeparam>
/// <param name="querySelector">A descriptor that describes the query operation</param>
Task<IValidateResponse> ValidateAsync<T>(Func<ValidateQueryDescriptor<T>, ValidateQueryDescriptor<T>> querySelector)
where T : class;
/// <summary>
/// The open and close index APIs allow to close an index, and later on opening it.
/// A closed index has almost no overhead on the cluster (except for maintaining its metadata), and is blocked
/// for read/write operations.
/// A closed index can be opened which will then go through the normal recovery process.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html
/// </summary>
/// <param name="openIndexSelector">A descriptor thata describes the open index operation</param>
IIndicesOperationResponse OpenIndex(Func<OpenIndexDescriptor, OpenIndexDescriptor> openIndexSelector);
/// <summary>
/// The open and close index APIs allow to close an index, and later on opening it.
/// A closed index has almost no overhead on the cluster (except for maintaining its metadata), and is blocked
/// for read/write operations.
/// A closed index can be opened which will then go through the normal recovery process.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html
/// </summary>
/// <param name="openIndexSelector">A descriptor thata describes the open index operation</param>
Task<IIndicesOperationResponse> OpenIndexAsync(Func<OpenIndexDescriptor, OpenIndexDescriptor> openIndexSelector);
/// <summary>
/// The open and close index APIs allow to close an index, and later on opening it.
/// A closed index has almost no overhead on the cluster (except for maintaining its metadata), and is blocked
/// for read/write operations.
/// A closed index can be opened which will then go through the normal recovery process.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html
/// </summary>
/// <param name="closeIndexSelector">A descriptor thata describes the close index operation</param>
IIndicesOperationResponse CloseIndex(Func<CloseIndexDescriptor, CloseIndexDescriptor> closeIndexSelector);
/// <summary>
/// The open and close index APIs allow to close an index, and later on opening it.
/// A closed index has almost no overhead on the cluster (except for maintaining its metadata), and is blocked
/// for read/write operations.
/// A closed index can be opened which will then go through the normal recovery process.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html
/// </summary>
/// <param name="closeIndexSelector">A descriptor thata describes the close index operation</param>
Task<IIndicesOperationResponse> CloseIndexAsync(Func<CloseIndexDescriptor, CloseIndexDescriptor> closeIndexSelector);
/// <summary>
/// The gateway snapshot API allows to explicitly perform a snapshot through the gateway of one or more indices (backup them).
/// By default, each index gateway periodically snapshot changes, though it can be disabled and be
/// controlled completely through this API.
/// <para>Note, this API only applies when using shared storage gateway implementation,
/// and does not apply when using the (default) local gateway.</para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-gateway-snapshot.html
/// </summary>
/// <param name="snapShotSelector">A descriptor that describes the parameters for the gateway snapshot operation</param>
IShardsOperationResponse GatewaySnapshot(Func<GatewaySnapshotDescriptor, GatewaySnapshotDescriptor> snapShotSelector = null);
/// <summary>
/// The gateway snapshot API allows to explicitly perform a snapshot through the gateway of one or more indices (backup them).
/// By default, each index gateway periodically snapshot changes, though it can be disabled and be
/// controlled completely through this API.
/// <para>Note, this API only applies when using shared storage gateway implementation,
/// and does not apply when using the (default) local gateway.</para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-gateway-snapshot.html
/// </summary>
/// <param name="snapShotSelector">A descriptor that describes the parameters for the gateway snapshot operation</param>
Task<IShardsOperationResponse> GatewaySnapshotAsync(Func<GatewaySnapshotDescriptor, GatewaySnapshotDescriptor> snapShotSelector = null);
/// <summary>
/// The refresh API allows to explicitly refresh one or more index, making all operations performed since the last refresh
/// available for search. The (near) real-time capabilities depend on the index engine used.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-refresh.html
/// </summary>
/// <param name="refreshSelector">A descriptor that describes the parameters for the refresh operation</param>
IShardsOperationResponse Refresh(Func<RefreshDescriptor, RefreshDescriptor> refreshSelector = null);
/// <summary>
/// The refresh API allows to explicitly refresh one or more index, making all operations performed since the last refresh
/// available for search. The (near) real-time capabilities depend on the index engine used.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-refresh.html
/// </summary>
/// <param name="refreshSelector">A descriptor that describes the parameters for the refresh operation</param>
Task<IShardsOperationResponse> RefreshAsync(Func<RefreshDescriptor, RefreshDescriptor> refreshSelector = null);
/// <summary>
/// Provide low level segments information that a Lucene index (shard level) is built with.
/// Allows to be used to provide more information on the state of a shard and an index, possibly optimization information,
/// data "wasted" on deletes, and so on.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-segments.html
/// </summary>
/// <param name="segmentsSelector">A descriptor that describes the parameters for the segments operation</param>
ISegmentsResponse Segments(Func<SegmentsDescriptor, SegmentsDescriptor> segmentsSelector = null);
/// <summary>
/// Provide low level segments information that a Lucene index (shard level) is built with.
/// Allows to be used to provide more information on the state of a shard and an index, possibly optimization information,
/// data "wasted" on deletes, and so on.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-segments.html
/// </summary>
/// <param name="segmentsSelector">A descriptor that describes the parameters for the segments operation</param>
Task<ISegmentsResponse> SegmentsAsync(Func<SegmentsDescriptor, SegmentsDescriptor> segmentsSelector = null);
/// <summary>
/// The cluster state API allows to get a comprehensive state information of the whole cluster.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-state.html
/// </summary>
/// <param name="clusterStateSelector">A descriptor that describes the parameters for the cluster state operation</param>
IClusterStateResponse ClusterState(Func<ClusterStateDescriptor, ClusterStateDescriptor> clusterStateSelector = null);
/// <summary>
/// The cluster state API allows to get a comprehensive state information of the whole cluster.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-state.html
/// </summary>
/// <param name="clusterStateSelector">A descriptor that describes the parameters for the cluster state operation</param>
Task<IClusterStateResponse> ClusterStateAsync(Func<ClusterStateDescriptor, ClusterStateDescriptor> clusterStateSelector = null);
/// <summary>
/// Allows to put a warmup search request on a specific index (or indices), with the body composing of a regular
/// search request. Types can be provided as part of the URI if the search request is designed to be run only
/// against the specific types.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html#warmer-adding
/// </summary>
/// <param name="name">The name for the warmer that you want to register</param>
/// <param name="selector">A descriptor that further describes what the warmer should look like</param>
IIndicesOperationResponse PutWarmer(string name, Func<PutWarmerDescriptor, PutWarmerDescriptor> selector);
/// <summary>
/// Allows to put a warmup search request on a specific index (or indices), with the body composing of a regular
/// search request. Types can be provided as part of the URI if the search request is designed to be run only
/// against the specific types.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html#warmer-adding
/// </summary>
/// <param name="name">The name for the warmer that you want to register</param>
/// <param name="selector">A descriptor that further describes what the warmer should look like</param>
Task<IIndicesOperationResponse> PutWarmerAsync(string name, Func<PutWarmerDescriptor, PutWarmerDescriptor> selector);
/// <summary>
/// Getting a warmer for specific index (or alias, or several indices) based on its name.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html#warmer-retrieving
/// </summary>
/// <param name="name">The name of the warmer to get</param>
/// <param name="selector">An optional selector specifying additional parameters for the get warmer operation</param>
IWarmerResponse GetWarmer(string name, Func<GetWarmerDescriptor, GetWarmerDescriptor> selector = null);
/// <summary>
/// Getting a warmer for specific index (or alias, or several indices) based on its name.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html#warmer-retrieving
/// </summary>
/// <param name="name">The name of the warmer to get</param>
/// <param name="selector">An optional selector specifying additional parameters for the get warmer operation</param>
Task<IWarmerResponse> GetWarmerAsync(string name, Func<GetWarmerDescriptor, GetWarmerDescriptor> selector = null);
/// <summary>
/// Deletes a warmer
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html#removing
/// </summary>
/// <param name="name">The name of the warmer to delete</param>
/// <param name="selector">An optional selector specifying additional parameters for the delete warmer operation</param>
IIndicesOperationResponse DeleteWarmer(string name, Func<DeleteWarmerDescriptor, DeleteWarmerDescriptor> selector = null);
/// <summary>
/// Deletes a warmer
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html#removing
/// </summary>
/// <param name="name">The name of the warmer to delete</param>
/// <param name="selector">An optional selector specifying additional parameters for the delete warmer operation</param>
Task<IIndicesOperationResponse> DeleteWarmerAsync(string name, Func<DeleteWarmerDescriptor, DeleteWarmerDescriptor> selector = null);
/// <summary>
/// Gets an index template
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html#getting
/// </summary>
/// <param name="name">The name of the template to get</param>
/// <param name="getTemplateSelector">An optional selector specifying additional parameters for the get template operation</param>
ITemplateResponse GetTemplate(string name, Func<GetTemplateDescriptor, GetTemplateDescriptor> getTemplateSelector = null);
/// <summary>
/// Gets an index template
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html#getting
/// </summary>
/// <param name="name">The name of the template to get</param>
/// <param name="getTemplateSelector">An optional selector specifying additional parameters for the get template operation</param>
Task<ITemplateResponse> GetTemplateAsync(string name, Func<GetTemplateDescriptor, GetTemplateDescriptor> getTemplateSelector = null);
/// <summary>
/// Index templates allow to define templates that will automatically be applied to new indices created.
/// <para>The templates include both settings and mappings, and a simple pattern template that controls if
/// the template will be applied to the index created. </para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html
/// </summary>
/// <param name="name">The name of the template to register</param>
/// <param name="putTemplateSelector">An optional selector specifying additional parameters for the put template operation</param>
IIndicesOperationResponse PutTemplate(string name, Func<PutTemplateDescriptor, PutTemplateDescriptor> putTemplateSelector);
/// <summary>
/// Index templates allow to define templates that will automatically be applied to new indices created.
/// <para>The templates include both settings and mappings, and a simple pattern template that controls if
/// the template will be applied to the index created. </para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html
/// </summary>
/// <param name="name">The name of the template to register</param>
/// <param name="putTemplateSelector">An optional selector specifying additional parameters for the put template operation</param>
Task<IIndicesOperationResponse> PutTemplateAsync(string name, Func<PutTemplateDescriptor, PutTemplateDescriptor> putTemplateSelector);
/// <summary>
/// Deletes an index template
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html#delete
/// </summary>
/// <param name="name">The name of the template to delete</param>
/// <param name="deleteTemplateSelector">An optional selector specifying additional parameters for the delete template operation</param>
IIndicesOperationResponse DeleteTemplate(string name, Func<DeleteTemplateDescriptor, DeleteTemplateDescriptor> deleteTemplateSelector = null);
/// <summary>
/// Deletes an index template
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html#delete
/// </summary>
/// <param name="name">The name of the template to delete</param>
/// <param name="deleteTemplateSelector">An optional selector specifying additional parameters for the delete template operation</param>
Task<IIndicesOperationResponse> DeleteTemplateAync(string name, Func<DeleteTemplateDescriptor, DeleteTemplateDescriptor> deleteTemplateSelector = null);
/// <summary>
/// Unregister a percolator
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <param name="name">The name for the percolator</param>
/// <param name="selector">An optional descriptor describing the unregister percolator operation further</param>
IUnregisterPercolateResponse UnregisterPercolator(string name, Func<UnregisterPercolatorDescriptor, UnregisterPercolatorDescriptor> selector = null);
/// <summary>
/// Unregister a percolator
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <param name="name">The name for the percolator</param>
/// <param name="selector">An optional descriptor describing the unregister percolator operation further</param>
Task<IUnregisterPercolateResponse> UnregisterPercolatorAsync(string name, Func<UnregisterPercolatorDescriptor, UnregisterPercolatorDescriptor> selector = null);
/// <summary>
/// Register a percolator
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from, will also be used to strongly type the query</typeparam>
/// <param name="name">The name for the percolator</param>
/// <param name="percolatorSelector">An optional descriptor describing the register percolator operation further</param>
IRegisterPercolateResponse RegisterPercolator<T>(string name, Func<RegisterPercolatorDescriptor<T>, RegisterPercolatorDescriptor<T>> percolatorSelector)
where T : class;
/// <summary>
/// Register a percolator
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from, will also be used to strongly type the query</typeparam>
/// <param name="name">The name for the percolator</param>
/// <param name="percolatorSelector">An optional descriptor describing the register percolator operation further</param>
Task<IRegisterPercolateResponse> RegisterPercolatorAsync<T>(string name, Func<RegisterPercolatorDescriptor<T>, RegisterPercolatorDescriptor<T>> percolatorSelector)
where T : class;
/// <summary>
/// Percolate a document
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from, and of the object that is being percolated</typeparam>
/// <param name="object">The object to percolator</param>
/// <param name="percolateSelector">An optional descriptor describing the percolate operation further</param>
IPercolateResponse Percolate<T>(T @object, Func<PercolateDescriptor<T, T>, PercolateDescriptor<T, T>> percolateSelector = null)
where T : class;
/// <summary>
/// Percolate a document
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from, and of the object that is being percolated</typeparam>
/// <param name="object">The object to percolator</param>
/// <param name="percolateSelector">An optional descriptor describing the percolate operation further</param>
Task<IPercolateResponse> PercolateAsync<T>(T @object, Func<PercolateDescriptor<T, T>, PercolateDescriptor<T, T>> percolateSelector = null)
where T : class;
/// <summary>
/// Percolate a document
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from</typeparam>
/// <typeparam name="K">The type of the object that is being percolated</typeparam>
/// <param name="object">The object to percolator</param>
/// <param name="percolateSelector">An optional descriptor describing the percolate operation further</param>
IPercolateResponse Percolate<T, K>(K @object, Func<PercolateDescriptor<T, K>, PercolateDescriptor<T, K>> percolateSelector = null)
where T : class
where K : class;
/// <summary>
/// Percolate a document
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from</typeparam>
/// <typeparam name="K">The type of the object that is being percolated</typeparam>
/// <param name="object">The object to percolator</param>
/// <param name="percolateSelector">An optional descriptor describing the percolate operation further</param>
Task<IPercolateResponse> PercolateAsync<T, K>(K @object, Func<PercolateDescriptor<T, K>, PercolateDescriptor<T, K>> percolateSelector = null)
where T : class
where K : class;
/// <summary>
/// Percolate a document but only return the number of matches not the matches itself
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from, and of the object that is being percolated</typeparam>
/// <param name="object">The object to percolator</param>
/// <param name="percolateSelector">An optional descriptor describing the percolate operation further</param>
IPercolateCountResponse PercolateCount<T>(T @object, Func<PercolateCountDescriptor<T, T>, PercolateCountDescriptor<T, T>> percolateSelector = null)
where T : class;
/// <summary>
/// Percolate a document but only return the number of matches not the matches itself
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from, and of the object that is being percolated</typeparam>
/// <param name="object">The object to percolator</param>
/// <param name="percolateSelector">An optional descriptor describing the percolate operation further</param>
Task<IPercolateCountResponse> PercolateCountAsync<T>(T @object, Func<PercolateCountDescriptor<T, T>, PercolateCountDescriptor<T, T>> percolateSelector = null)
where T : class;
/// <summary>
/// Percolate a document but only return the number of matches not the matches itself
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from</typeparam>
/// <typeparam name="K">The type of the object that is being percolated</typeparam>
/// <param name="object">The object to percolator</param>
/// <param name="percolateSelector">An optional descriptor describing the percolate operation further</param>
IPercolateCountResponse PercolateCount<T, K>(K @object, Func<PercolateCountDescriptor<T, K>, PercolateCountDescriptor<T, K>> percolateSelector = null)
where T : class
where K : class;
/// <summary>
/// Percolate a document but only return the number of matches not the matches itself
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
/// </summary>
/// <typeparam name="T">The type to infer the index/type from</typeparam>
/// <typeparam name="K">The type of the object that is being percolated</typeparam>
/// <param name="object">The object to percolator</param>
/// <param name="percolateSelector">An optional descriptor describing the percolate operation further</param>
Task<IPercolateCountResponse> PercolateCountAsync<T, K>(K @object, Func<PercolateCountDescriptor<T, K>, PercolateCountDescriptor<T, K>> percolateSelector = null)
where T : class
where K : class;
/// <summary>
/// The put mapping API allows to register specific mapping definition for a specific type.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html
/// </summary>
/// <typeparam name="T">The type we want to map in elasticsearch</typeparam>
/// <param name="mappingSelector">A descriptor to describe the mapping of our type</param>
IIndicesResponse Map<T>(Func<PutMappingDescriptor<T>, PutMappingDescriptor<T>> mappingSelector)
where T : class;
/// <summary>
/// The put mapping API allows to register specific mapping definition for a specific type.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html
/// </summary>
/// <typeparam name="T">The type we want to map in elasticsearch</typeparam>
/// <param name="mappingSelector">A descriptor to describe the mapping of our type</param>
Task<IIndicesResponse> MapAsync<T>(Func<PutMappingDescriptor<T>, PutMappingDescriptor<T>> mappingSelector)
where T : class;
/// <summary>
/// The get mapping API allows to retrieve mapping definitions for an index or index/type.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the get mapping operation</param>
IGetMappingResponse GetMapping(Func<GetMappingDescriptor, GetMappingDescriptor> selector);
/// <summary>
/// The get mapping API allows to retrieve mapping definitions for an index or index/type.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the get mapping operation</param>
Task<IGetMappingResponse> GetMappingAsync(Func<GetMappingDescriptor, GetMappingDescriptor> selector);
/// <summary>
/// Allow to delete a mapping (type) along with its data.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-mapping.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the delete mapping operation</param>
IIndicesResponse DeleteMapping(Func<DeleteMappingDescriptor, DeleteMappingDescriptor> selector);
/// <summary>
/// Allow to delete a mapping (type) along with its data.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-mapping.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the delete mapping operation</param>
Task<IIndicesResponse> DeleteMappingAsync(Func<DeleteMappingDescriptor, DeleteMappingDescriptor> selector);
/// <summary>
/// The flush API allows to flush one or more indices through an API. The flush process of an index basically
/// frees memory from the index by flushing data to the index storage and clearing the internal transaction log.
/// By default, Elasticsearch uses memory heuristics in order to automatically trigger
/// flush operations as required in order to clear memory.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-flush.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the flush operation</param>
IShardsOperationResponse Flush(Func<FlushDescriptor, FlushDescriptor> selector);
/// <summary>
/// The flush API allows to flush one or more indices through an API. The flush process of an index basically
/// frees memory from the index by flushing data to the index storage and clearing the internal transaction log.
/// By default, Elasticsearch uses memory heuristics in order to automatically trigger
/// flush operations as required in order to clear memory.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-flush.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the flush operation</param>
Task<IShardsOperationResponse> FlushAsync(Func<FlushDescriptor, FlushDescriptor> selector);
/// <summary>
/// The get settings API allows to retrieve settings of index/indices.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-settings.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the get index settings operation</param>
IIndexSettingsResponse GetIndexSettings(Func<GetIndexSettingsDescriptor, GetIndexSettingsDescriptor> selector);
/// <summary>
/// The get settings API allows to retrieve settings of index/indices.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-settings.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the get index settings operation</param>
Task<IIndexSettingsResponse> GetIndexSettingsAsync(Func<GetIndexSettingsDescriptor, GetIndexSettingsDescriptor> selector);
/// <summary>
/// The delete index API allows to delete an existing index.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-index.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the delete index operation</param>
IIndicesResponse DeleteIndex(Func<DeleteIndexDescriptor, DeleteIndexDescriptor> selector);
/// <summary>
/// The delete index API allows to delete an existing index.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-index.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the delete index operation</param>
Task<IIndicesResponse> DeleteIndexAsync(Func<DeleteIndexDescriptor, DeleteIndexDescriptor> selector);
/// <summary>
/// The clear cache API allows to clear either all caches or specific cached associated with one ore more indices.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-clearcache.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the clear cache operation</param>
IShardsOperationResponse ClearCache(Func<ClearCacheDescriptor, ClearCacheDescriptor> selector = null);
/// <summary>
/// The clear cache API allows to clear either all caches or specific cached associated with one ore more indices.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-clearcache.html
/// </summary>
/// <param name="selector">A descriptor that describes the parameters for the clear cache operation</param>
Task<IShardsOperationResponse> ClearCacheAsync(Func<ClearCacheDescriptor, ClearCacheDescriptor> selector = null);
/// <summary>
/// The create index API allows to instantiate an index. Elasticsearch provides support for multiple indices,
/// including executing operations across several indices.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html
/// </summary>
/// <param name="index">The name of the index to be created</param>
/// <param name="createIndexSelector">A descriptor that further describes the parameters for the create index operation</param>
IIndicesOperationResponse CreateIndex(string index, Func<CreateIndexDescriptor, CreateIndexDescriptor> createIndexSelector = null);
/// <summary>
/// The create index API allows to instantiate an index. Elasticsearch provides support for multiple indices,
/// including executing operations across several indices.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html
/// </summary>
/// <param name="index">The name of the index to be created</param>
/// <param name="createIndexSelector">A descriptor that further describes the parameters for the create index operation</param>
Task<IIndicesOperationResponse> CreateIndexAsync(string index, Func<CreateIndexDescriptor, CreateIndexDescriptor> createIndexSelector);
/// <summary>
/// Does a request to the root of an elasticsearch node
/// </summary>
/// <param name="selector">A descriptor to further describe the root operation</param>
IRootInfoResponse RootNodeInfo(Func<InfoDescriptor, InfoDescriptor> selector = null);
/// <summary>
/// Does a request to the root of an elasticsearch node
/// </summary>
/// <param name="selector">A descriptor to further describe the root operation</param>
Task<IRootInfoResponse> RootNodeInfoAsync(Func<InfoDescriptor, InfoDescriptor> selector = null);
/// <summary>
/// Indices level stats provide statistics on different operations happening on an index. The API provides statistics on
/// the index level scope (though most stats can also be retrieved using node level scope).
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html
/// </summary>
/// <param name="selector">Optionaly further describe the indices stats operation</param>
IGlobalStatsResponse IndicesStats(Func<IndicesStatsDescriptor, IndicesStatsDescriptor> selector = null);
/// <summary>
/// Indices level stats provide statistics on different operations happening on an index. The API provides statistics on
/// the index level scope (though most stats can also be retrieved using node level scope).
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html
/// </summary>
/// <param name="selector">Optionaly further describe the indices stats operation</param>
Task<IGlobalStatsResponse> IndicesStatsAsync(Func<IndicesStatsDescriptor, IndicesStatsDescriptor> selector = null);
/// <summary>
/// The cluster nodes info API allows to retrieve one or more (or all) of the cluster nodes information.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-info.html
/// </summary>
/// <param name="selector">An optional descriptor to further describe the nodes info operation</param>
INodeInfoResponse NodesInfo(Func<NodesInfoDescriptor, NodesInfoDescriptor> selector = null);
/// <summary>
/// The cluster nodes info API allows to retrieve one or more (or all) of the cluster nodes information.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-info.html
/// </summary>
/// <param name="selector">An optional descriptor to further describe the nodes info operation</param>
Task<INodeInfoResponse> NodesInfoAsync(Func<NodesInfoDescriptor, NodesInfoDescriptor> selector = null);
/// <summary>
/// The cluster nodes stats API allows to retrieve one or more (or all) of the cluster nodes statistics.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html
/// </summary>
/// <param name="selector">An optional descriptor to further describe the nodes stats operation</param>
INodeStatsResponse NodesStats(Func<NodesStatsDescriptor, NodesStatsDescriptor> selector = null);
/// <summary>
/// The cluster nodes stats API allows to retrieve one or more (or all) of the cluster nodes statistics.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html
/// </summary>
/// <param name="selector">An optional descriptor to further describe the nodes stats operation</param>
Task<INodeStatsResponse> NodesStatsAsync(Func<NodesStatsDescriptor, NodesStatsDescriptor> selector = null);
/// <summary>
/// Used to check if the index (indices) exists or not.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-exists.html
/// </summary>
/// <param name="selector">A descriptor that describes the index exist operation</param>
IExistsResponse IndexExists(Func<IndexExistsDescriptor, IndexExistsDescriptor> selector);
/// <summary>
/// Used to check if the index (indices) exists or not.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-exists.html
/// </summary>
/// <param name="selector">A descriptor that describes the index exist operation</param>
Task<IExistsResponse> IndexExistsAsync(Func<IndexExistsDescriptor, IndexExistsDescriptor> selector);
/// <summary>
/// The more like this (mlt) API allows to get documents that are "like" a specified document.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-more-like-this.html
/// </summary>
/// <typeparam name="T">Type used to infer the default index and typename and used to describe the search</typeparam>
/// <param name="mltSelector">A descriptor that describes the more like this operation</param>
ISearchResponse<T> MoreLikeThis<T>(Func<MoreLikeThisDescriptor<T>, MoreLikeThisDescriptor<T>> mltSelector)
where T : class;
/// <summary>
/// The more like this (mlt) API allows to get documents that are "like" a specified document.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-more-like-this.html
/// </summary>
/// <typeparam name="T">Type used to infer the default index and typename and used to describe the search</typeparam>
/// <param name="mltSelector">A descriptor that describes the more like this operation</param>
Task<ISearchResponse<T>> MoreLikeThisAsync<T>(Func<MoreLikeThisDescriptor<T>, MoreLikeThisDescriptor<T>> mltSelector)
where T : class;
/// <summary>
/// The cluster health API allows to get a very simple status on the health of the cluster.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html
/// </summary>
/// <param name="clusterHealthSelector">An optional descriptor to further describe the cluster health operation</param>
IHealthResponse ClusterHealth(Func<ClusterHealthDescriptor, ClusterHealthDescriptor> clusterHealthSelector = null);
/// <summary>
/// The cluster health API allows to get a very simple status on the health of the cluster.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html
/// </summary>
/// <param name="clusterHealthSelector">An optional descriptor to further describe the cluster health operation</param>
Task<IHealthResponse> ClusterHealthAsync(Func<ClusterHealthDescriptor, ClusterHealthDescriptor> clusterHealthSelector = null);
/// <summary>
/// Performs the analysis process on a text and return the tokens breakdown of the text.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-analyze.html
/// </summary>
/// <param name="analyzeSelector">A descriptor that describes the analyze operation</param>
IAnalyzeResponse Analyze(Func<AnalyzeDescriptor, AnalyzeDescriptor> analyzeSelector);
/// <summary>
/// Performs the analysis process on a text and return the tokens breakdown of the text.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-analyze.html
/// </summary>
/// <param name="analyzeSelector">A descriptor that describes the analyze operation</param>
Task<IAnalyzeResponse> AnalyzeAsync(Func<AnalyzeDescriptor, AnalyzeDescriptor> analyzeSelector);
/// <summary>
/// The search API allows to execute a search query and get back search hits that match the query.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html
/// </summary>
/// <typeparam name="T">The type used to infer the index and typename as well describe the query strongly typed</typeparam>
/// <param name="searchSelector">A descriptor that describes the parameters for the search operation</param>
ISearchResponse<T> Search<T>(Func<SearchDescriptor<T>, SearchDescriptor<T>> searchSelector)
where T : class;
/// <summary>
/// The search API allows to execute a search query and get back search hits that match the query.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html
/// </summary>
/// <typeparam name="T">The type used to infer the index and typename as well describe the query strongly typed</typeparam>
/// <typeparam name="TResult">The type used to describe the strongly typed query</typeparam>
/// <param name="searchSelector">A descriptor that describes the parameters for the search operation</param>
ISearchResponse<TResult> Search<T, TResult>(Func<SearchDescriptor<T>, SearchDescriptor<T>> searchSelector)
where T : class
where TResult : class;
/// <summary>
/// The search API allows to execute a search query and get back search hits that match the query.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html
/// </summary>
/// <typeparam name="T">The type used to infer the index and typename as well describe the query strongly typed</typeparam>
/// <param name="searchSelector">A descriptor that describes the parameters for the search operation</param>
Task<ISearchResponse<T>> SearchAsync<T>(Func<SearchDescriptor<T>, SearchDescriptor<T>> searchSelector)
where T : class;
/// <summary>
/// The search API allows to execute a search query and get back search hits that match the query.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html
/// </summary>
/// <typeparam name="T">The type used to infer the index and typename</typeparam>
/// <typeparam name="TResult">The type used to describe the strongly typed query</typeparam>
/// <param name="searchSelector">A descriptor that describes the parameters for the search operation</param>
Task<ISearchResponse<TResult>> SearchAsync<T, TResult>(Func<SearchDescriptor<T>, SearchDescriptor<T>> searchSelector)
where T : class
where TResult : class;
/// <summary>
/// The multi search API allows to execute several search requests within the same API.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-multi-search.html
/// </summary>
/// <param name="multiSearchSelector">A descriptor that describes the search operations on the multi search api</param>
IMultiSearchResponse MultiSearch(Func<MultiSearchDescriptor, MultiSearchDescriptor> multiSearchSelector);
/// <summary>
/// The multi search API allows to execute several search requests within the same API.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-multi-search.html
/// </summary>
/// <param name="multiSearchSelector">A descriptor that describes the search operations on the multi search api</param>
Task<IMultiSearchResponse> MultiSearchAsync(Func<MultiSearchDescriptor, MultiSearchDescriptor> multiSearchSelector);
/// <summary>
/// The count API allows to easily execute a query and get the number of matches for that query.
/// It can be executed across one or more indices and across one or more types.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-count.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename as well as describe the strongly
/// typed parts of the query</typeparam>
/// <param name="countSelector">An optional descriptor to further describe the count operation</param>
ICountResponse Count<T>(Func<CountDescriptor<T>, CountDescriptor<T>> countSelector = null)
where T : class;
/// <summary>
/// The count API allows to easily execute a query and get the number of matches for that query.
/// It can be executed across one or more indices and across one or more types.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-count.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename as well as describe the strongly
/// typed parts of the query</typeparam>
/// <param name="countSelector">An optional descriptor to further describe the count operation</param>
Task<ICountResponse> CountAsync<T>(Func<CountDescriptor<T>, CountDescriptor<T>> countSelector = null)
where T : class;
/// <summary>
/// The delete by query API allows to delete documents from one or more indices and one or more types based on a query.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename as well as describe the strongly
/// typed parts of the query</typeparam>
/// <param name="deleteByQuerySelector">An optional descriptor to further describe the delete by query operation</param>
IDeleteResponse DeleteByQuery<T>(Func<DeleteByQueryDescriptor<T>, DeleteByQueryDescriptor<T>> deleteByQuerySelector)
where T : class;
/// <summary>
/// The delete by query API allows to delete documents from one or more indices and one or more types based on a query.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename as well as describe the strongly
/// typed parts of the query</typeparam>
/// <param name="deleteByQuerySelector">An optional descriptor to further describe the delete by query operation</param>
Task<IDeleteResponse> DeleteByQueryAsync<T>(
Func<DeleteByQueryDescriptor<T>, DeleteByQueryDescriptor<T>> deleteByQuerySelector)
where T : class;
/// <summary>
/// The bulk API makes it possible to perform many index/delete operations in a single API call.
/// This can greatly increase the indexing speed.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html
/// </summary>
/// <param name="bulkSelector">A descriptor the describe the index/create/delete operation for this bulk operation</param>
IBulkResponse Bulk(Func<BulkDescriptor, BulkDescriptor> bulkSelector);
/// <summary>
/// The bulk API makes it possible to perform many index/delete operations in a single API call.
/// This can greatly increase the indexing speed.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html
/// </summary>
/// <param name="bulkSelector">A descriptor the describe the index/create/delete operation for this bulk operation</param>
Task<IBulkResponse> BulkAsync(Func<BulkDescriptor, BulkDescriptor> bulkSelector);
/// <summary>
/// Shortcut into the <see cref="Bulk"/> call that deletes the specified objects
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="objects">List of objects to delete</param>
/// <param name="index">Override the inferred indexname for T</param>
/// <param name="type">Override the inferred typename for T</param>
IBulkResponse DeleteMany<T>(IEnumerable<T> @objects, string index = null, string type = null)
where T : class;
/// <summary>
/// Shortcut into the <see cref="Bulk"/> call that deletes the specified objects
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="objects">List of objects to delete</param>
/// <param name="index">Override the inferred indexname for T</param>
/// <param name="type">Override the inferred typename for T</param>
Task<IBulkResponse> DeleteManyAsync<T>(IEnumerable<T> objects, string index = null, string type = null)
where T : class;
/// <summary>
/// The index API adds or updates a typed JSON document in a specific index, making it searchable.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="object">The object to be indexed, Id will be inferred (Id property or IdProperty attribute on type)</param>
/// <param name="indexSelector">Optionally furter describe the index operation i.e override type/index/id</param>
IIndexResponse Index<T>(T @object, Func<IndexDescriptor<T>, IndexDescriptor<T>> indexSelector = null)
where T : class;
/// <summary>
/// The index API adds or updates a typed JSON document in a specific index, making it searchable.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="object">The object to be indexed, Id will be inferred (Id property or IdProperty attribute on type)</param>
/// <param name="indexSelector">Optionally furter describe the index operation i.e override type/index/id</param>
Task<IIndexResponse> IndexAsync<T>(T @object, Func<IndexDescriptor<T>, IndexDescriptor<T>> indexSelector = null)
where T : class;
/// <summary>
///The delete API allows to delete a typed JSON document from a specific index based on its id.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="deleteSelector">Describe the delete operation, i.e type/index/id</param>
IDeleteResponse Delete<T>(Func<DeleteDescriptor<T>, DeleteDescriptor<T>> deleteSelector)
where T : class;
/// <summary>
///The delete API allows to delete a typed JSON document from a specific index based on its id.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="deleteSelector">Describe the delete operation, i.e type/index/id</param>
Task<IDeleteResponse> DeleteAsync<T>(Func<DeleteDescriptor<T>, DeleteDescriptor<T>> deleteSelector)
where T : class;
/// <summary>
/// Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing).
/// The response includes a docs array with all the fetched documents, each element similar in structure to a document
/// provided by the get API.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html
/// </summary>
/// <param name="multiGetSelector">A descriptor describing which documents should be fetched</param>
IMultiGetResponse MultiGet(Func<MultiGetDescriptor, MultiGetDescriptor> multiGetSelector);
/// <summary>
/// Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing).
/// The response includes a docs array with all the fetched documents, each element similar in structure to a document
/// provided by the get API.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html
/// </summary>
/// <param name="multiGetSelector">A descriptor describing which documents should be fetched</param>
Task<IMultiGetResponse> MultiGetAsync(Func<MultiGetDescriptor, MultiGetDescriptor> multiGetSelector);
/// <summary>
/// Use the /{index}/{type}/{id}/_source endpoint to get just the _source field of the document,
/// without any additional content around it.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html#_source
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="getSelector">A descriptor that describes which document's source to fetch</param>
T Source<T>(Func<SourceDescriptor<T>, SourceDescriptor<T>> getSelector)
where T : class;
/// <summary>
/// Use the /{index}/{type}/{id}/_source endpoint to get just the _source field of the document,
/// without any additional content around it.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html#_source
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="getSelector">A descriptor that describes which document's source to fetch</param>
Task<T> SourceAsync<T>(Func<SourceDescriptor<T>, SourceDescriptor<T>> getSelector)
where T : class;
/// <summary>
/// The get API allows to get a typed JSON document from the index based on its id.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="getSelector">A descriptor that describes which document to fetch and how</param>
IGetResponse<T> Get<T>(Func<GetDescriptor<T>, GetDescriptor<T>> getSelector)
where T : class;
/// <summary>
/// The get API allows to get a typed JSON document from the index based on its id.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="getSelector">A descriptor that describes which document to fetch and how</param>
Task<IGetResponse<T>> GetAsync<T>(Func<GetDescriptor<T>, GetDescriptor<T>> getSelector)
where T : class;
/// <summary>
/// APIs in elasticsearch accept an index name when working against a specific index, and several indices when applicable.
/// <para>The index aliases API allow to alias an index with a name, with all APIs automatically converting the alias name to the
/// actual index name.</para><para> An alias can also be mapped to more than one index, and when specifying it, the alias
/// will automatically expand to the aliases indices.i</para><para> An alias can also be associated with a filter that will
/// automatically be applied when searching, and routing values.</para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html
/// </summary>
/// <param name="aliasSelector">A desriptor that describes the parameters for the alias operation</param>
IIndicesOperationResponse Alias(Func<AliasDescriptor, AliasDescriptor> aliasSelector);
/// <summary>
/// APIs in elasticsearch accept an index name when working against a specific index, and several indices when applicable.
/// <para>The index aliases API allow to alias an index with a name, with all APIs automatically converting the alias name to the
/// actual index name.</para><para> An alias can also be mapped to more than one index, and when specifying it, the alias
/// will automatically expand to the aliases indices.i</para><para> An alias can also be associated with a filter that will
/// automatically be applied when searching, and routing values.</para>
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html
/// </summary>
/// <param name="aliasSelector">A desriptor that describes the parameters for the alias operation</param>
Task<IIndicesOperationResponse> AliasAsync(Func<AliasDescriptor, AliasDescriptor> aliasSelector);
/// <summary>
/// The get index alias api allows to filter by alias name and index name. This api redirects to the master and fetches
/// the requested index aliases, if available. This api only serialises the found index aliases.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html#alias-retrieving
/// </summary>
/// <param name="getAliasesDescriptor">A descriptor that describes which aliases/indexes we are interested int</param>
IGetAliasesResponse GetAliases(Func<GetAliasesDescriptor, GetAliasesDescriptor> getAliasesDescriptor);
/// <summary>
/// The get index alias api allows to filter by alias name and index name. This api redirects to the master and fetches
/// the requested index aliases, if available. This api only serialises the found index aliases.
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html#alias-retrieving
/// </summary>
/// <param name="getAliasesDescriptor">A descriptor that describes which aliases/indexes we are interested int</param>
Task<IGetAliasesResponse> GetAliasesAsync(Func<GetAliasesDescriptor, GetAliasesDescriptor> getAliasesDescriptor);
/// <summary>
/// Shortcut into the <see cref="Bulk"/> call that indexes the specified objects
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>
/// <param name="objects">List of objects to index, Id will be inferred (Id property or IdProperty attribute on type)</param>
/// <param name="index">Override the inferred indexname for T</param>
/// <param name="type">Override the inferred typename for T</param>
IBulkResponse IndexMany<T>(IEnumerable<T> @objects, string index = null, string type = null)
where T : class;
/// <summary>
/// Shortcut into the <see cref="Bulk"/> call that indexes the specified objects
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html
/// </summary>
/// <typeparam name="T">The type used to infer the default index and typename</typeparam>