UNPKG

65 kBTypeScriptView Raw
1// Type definitions for elasticsearch 5.0
2// Project: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/16.x/index.html
3// Definitions by: Casper Skydt <https://github.com/CasperSkydt>
4// Blake Smith <https://github.com/bfsmith>
5// Dave Dunkin <https://github.com/ddunkin>
6// Jeffery Grajkowski <https://github.com/pushplay>
7// Margus Lamp <https://github.com/mlamp>
8// Ahmad Ferdous Bin Alam <https://github.com/ahmadferdous>
9// Simon Schick <https://github.com/SimonSchick>
10// Paul Brabban <https://github.com/brabster>
11// Budi Irawan <https://github.com/deerawan>
12// Yonatan Kiron <https://github.com/YonatanKiron>
13// Jani Šumak <https://github.com/dasdachs>
14// Chris Midgley <https://github.com/midgleyc>
15// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
16// TypeScript Version: 2.2
17
18import HttpConnector = require("./src/lib/connectors/http");
19
20export class Client {
21 constructor(params: ConfigOptions);
22 cat: Cat;
23 cluster: Cluster;
24 indices: Indices;
25 ingest: Ingest;
26 nodes: Nodes;
27 snapshot: Snapshot;
28 tasks: Tasks;
29 bulk(params: BulkIndexDocumentsParams, callback: (error: any, response: any) => void): void;
30 bulk(params: BulkIndexDocumentsParams): Promise<any>;
31 clearScroll(params: ClearScrollParams, callback: (error: any, response: any) => void): void;
32 clearScroll(params: ClearScrollParams): Promise<any>;
33 count(params: CountParams, callback: (error: any, response: CountResponse) => void): void;
34 count(params: CountParams): Promise<CountResponse>;
35 create(params: CreateDocumentParams, callback: (err: any, response: CreateDocumentResponse, status: any) => void): void;
36 create(params: CreateDocumentParams): Promise<CreateDocumentResponse>;
37 delete(params: DeleteDocumentParams, callback: (error: any, response: DeleteDocumentResponse) => void): void;
38 delete(params: DeleteDocumentParams): Promise<DeleteDocumentResponse>;
39 deleteByQuery(params: DeleteDocumentByQueryParams, callback: (error: any, response: DeleteDocumentByQueryResponse) => void): void;
40 deleteByQuery(params: DeleteDocumentByQueryParams): Promise<DeleteDocumentByQueryResponse>;
41 deleteScript(params: DeleteScriptParams, callback: (error: any, response: any) => void): void;
42 deleteScript(params: DeleteScriptParams): Promise<any>;
43 deleteTemplate(params: DeleteTemplateParams, callback: (error: any, response: any) => void): void;
44 deleteTemplate(params: DeleteTemplateParams): Promise<any>;
45 exists(params: ExistsParams, callback: (error: any, response: boolean, status?: any) => void): void;
46 exists(params: ExistsParams): Promise<boolean>;
47 explain(params: ExplainParams, callback: (error: any, response: ExplainResponse) => void): void;
48 explain(params: ExplainParams): Promise<ExplainResponse>;
49 fieldStats(params: FieldStatsParams, callback: (error: any, response: FieldStatsResponse) => void): void;
50 fieldStats(params: FieldStatsParams): Promise<FieldStatsResponse>;
51 get<T>(params: GetParams, callback: (error: any, response: GetResponse<T>) => void): void;
52 get<T>(params: GetParams): Promise<GetResponse<T>>;
53 getScript(params: GetScriptParams, callback: (error: any, response: any) => void): void;
54 getScript(params: GetScriptParams): Promise<any>;
55 getSource(params: GetSourceParams, callback: (error: any, response: any) => void): void;
56 getSource(params: GetSourceParams): Promise<any>;
57 getTemplate(params: GetTemplateParams, callback: (error: any, response: any) => void): void;
58 getTemplate(params: GetTemplateParams): Promise<any>;
59 index<T>(params: IndexDocumentParams<T>, callback: (error: any, response: any) => void): void;
60 index<T>(params: IndexDocumentParams<T>): Promise<any>;
61 info(params: InfoParams, callback: (error: any, response: any) => void): void;
62 info(params: InfoParams): Promise<any>;
63 mget<T>(params: MGetParams, callback: (error: any, response: MGetResponse<T>) => void): void;
64 mget<T>(params: MGetParams): Promise<MGetResponse<T>>;
65 msearch<T>(params: MSearchParams, callback: (error: any, response: MSearchResponse<T>) => void): void;
66 msearch<T>(params: MSearchParams): Promise<MSearchResponse<T>>;
67 msearchTemplate<T>(params: MSearchTemplateParams, callback: (error: any, response: MSearchResponse<T>) => void): void;
68 msearchTemplate<T>(params: MSearchTemplateParams): Promise<MSearchResponse<T>>;
69 mtermvectors(params: MTermVectorsParams, callback: (error: any, response: any) => void): void;
70 mtermvectors(params: MTermVectorsParams): Promise<any>;
71 ping(params: PingParams, callback: (err: any, response: any, status: any) => void): void;
72 ping(params: PingParams): Promise<any>;
73 putScript(params: PutScriptParams, callback: (err: any, response: any, status: any) => void): void;
74 putScript(params: PutScriptParams): Promise<any>;
75 putTemplate(params: PutTemplateParams, callback: (err: any, response: any, status: any) => void): void;
76 putTemplate(params: PutTemplateParams): Promise<any>;
77 reindex(params: ReindexParams, callback: (error: any, response: ReindexResponse) => void): void;
78 reindex(params: ReindexParams): Promise<ReindexResponse>;
79 reindexRethrottle(params: ReindexRethrottleParams, callback: (error: any, response: any) => void): void;
80 reindexRethrottle(params: ReindexRethrottleParams): Promise<any>;
81 renderSearchTemplate(params: RenderSearchTemplateParams, callback: (error: any, response: any) => void): void;
82 renderSearchTemplate(params: RenderSearchTemplateParams): Promise<any>;
83 scroll<T>(params: ScrollParams, callback: (error: any, response: SearchResponse<T>) => void): void;
84 scroll<T>(params: ScrollParams): Promise<SearchResponse<T>>;
85 search<T>(params: SearchParams, callback: (error: any, response: SearchResponse<T>) => void): void;
86 search<T>(params: SearchParams): Promise<SearchResponse<T>>;
87 searchShards(params: SearchShardsParams, callback: (error: any, response: SearchShardsResponse) => void): void;
88 searchShards(params: SearchShardsParams): Promise<SearchShardsResponse>;
89 searchTemplate(params: SearchTemplateParams, callback: (error: any, response: any) => void): void;
90 searchTemplate(params: SearchTemplateParams): Promise<any>;
91 suggest(params: SuggestParams, callback: (error: any, response: any) => void): void;
92 suggest(params: SuggestParams): Promise<any>;
93 termvectors(params: TermvectorsParams, callback: (error: any, response: any) => void): void;
94 termvectors(params: TermvectorsParams): Promise<any>;
95 update(params: UpdateDocumentParams, callback: (error: any, response: any) => void): void;
96 update(params: UpdateDocumentParams): Promise<any>;
97 updateByQuery(params: UpdateDocumentByQueryParams, callback: (error: any, response: UpdateDocumentByQueryResponse) => void): void;
98 updateByQuery(params: UpdateDocumentByQueryParams): Promise<UpdateDocumentByQueryResponse>;
99 close(): void;
100}
101
102export interface ConfigOptions {
103 host?: any;
104 hosts?: any;
105 httpAuth?: string | undefined;
106 log?: any;
107 apiVersion?: string | undefined;
108 plugins?: any;
109 sniffOnStart?: boolean | undefined;
110 sniffInterval?: number | undefined;
111 sniffOnConnectionFault?: boolean | undefined;
112 maxRetries?: number | undefined;
113 requestTimeout?: number | undefined;
114 deadTimeout?: number | undefined;
115 pingTimeout?: number | undefined;
116 keepAlive?: boolean | undefined;
117 maxSockets?: number | undefined;
118 suggestCompression?: boolean | undefined;
119 connectionClass?: string | typeof HttpConnector | undefined;
120 sniffedNodesProtocol?: string | undefined;
121 ssl?: object | undefined;
122 selector?: any;
123 defer?: (() => void) | undefined;
124 nodesToHostCallback?: any;
125 createNodeAgent?: any;
126}
127
128export interface Explanation {
129 value: number;
130 description: string;
131 details: Explanation[];
132}
133
134export interface GenericParams {
135 requestTimeout?: number | undefined;
136 maxRetries?: number | undefined;
137 method?: string | undefined;
138 body?: any;
139 ignore?: number | number[] | undefined;
140 filterPath?: string | string[] | undefined;
141}
142
143export interface ShardsResponse {
144 total: number;
145 successful: number;
146 failed: number;
147 skipped: number;
148}
149
150/**
151 * A string of a number and a time unit. A time unit is one of
152 * [d, h, m, s, ms, micros, nanos]. eg: "30s" for 30 seconds.
153 * These are incorrectly identified as `Date | number` in the docs as of 2016-11-15.
154 */
155export type TimeSpan = string;
156
157export type NameList = string | string[] | boolean;
158export type Refresh = boolean | "true" | "false" | "wait_for" | "";
159export type VersionType = "internal" | "external" | "external_gte" | "force";
160export type ExpandWildcards = "open" | "closed" | "none" | "all";
161export type DefaultOperator = "AND" | "OR";
162export type Conflicts = "abort" | "proceed";
163
164export interface BulkIndexDocumentsParams extends GenericParams {
165 waitForActiveShards?: string | undefined;
166 refresh?: Refresh | undefined;
167 routing?: string | undefined;
168 timeout?: TimeSpan | undefined;
169 type?: string | undefined;
170 fields?: NameList | undefined;
171 _source?: NameList | undefined;
172 _sourceExclude?: NameList | undefined;
173 _sourceInclude?: NameList | undefined;
174 pipeline?: string | undefined;
175 index?: string | undefined;
176}
177
178export interface ClearScrollParams extends GenericParams {
179 scrollId: NameList;
180}
181
182export interface CountParams extends GenericParams {
183 ignoreUnavailable?: boolean | undefined;
184 allowNoIndices?: boolean | undefined;
185 expandWildcards?: ExpandWildcards | undefined;
186 minScore?: number | undefined;
187 preference?: string | undefined;
188 routing?: string | undefined;
189 q?: string | undefined;
190 analyzer?: string | undefined;
191 analyzeWildcard?: boolean | undefined;
192 defaultOperator?: DefaultOperator | undefined;
193 df?: string | undefined;
194 lenient?: boolean | undefined;
195 lowercaseExpandedTerms?: boolean | undefined;
196 index?: NameList | undefined;
197 type?: NameList | undefined;
198}
199
200export interface CountResponse {
201 count: number;
202 _shards: ShardsResponse;
203}
204
205export interface CreateDocumentParams extends GenericParams {
206 waitForActiveShards?: string | undefined;
207 parent?: string | undefined;
208 refresh?: Refresh | undefined;
209 routing?: string | undefined;
210 timeout?: TimeSpan | undefined;
211 timestamp?: Date | number | undefined;
212 ttl?: TimeSpan | undefined;
213 version?: number | undefined;
214 versionType?: VersionType | undefined;
215 pipeline?: string | undefined;
216 id?: string | undefined;
217 index: string;
218 type: string;
219}
220
221export interface CreateDocumentResponse {
222 _shards: ShardsResponse;
223 _index: string;
224 _type: string;
225 _id: string;
226 _version: number;
227 created: boolean;
228 result: string;
229}
230
231export interface DeleteDocumentParams extends GenericParams {
232 waitForActiveShards?: string | undefined;
233 parent?: string | undefined;
234 refresh?: Refresh | undefined;
235 routing?: string | undefined;
236 timeout?: TimeSpan | undefined;
237 version?: number | undefined;
238 versionType?: VersionType | undefined;
239 index: string;
240 type: string;
241 id: string;
242}
243
244export interface DeleteDocumentResponse {
245 _shards: ShardsResponse;
246 found: boolean;
247 _index: string;
248 _type: string;
249 _id: string;
250 _version: number;
251 result: string;
252}
253
254export interface DeleteDocumentByQueryParams extends GenericParams {
255 analyzer?: string | undefined;
256 analyzeWildcard?: boolean | undefined;
257 defaultOperator?: DefaultOperator | undefined;
258 df?: string | undefined;
259 from?: number | undefined;
260 ignoreUnavailable?: boolean | undefined;
261 allowNoIndices?: boolean | undefined;
262 conflicts?: Conflicts | undefined;
263 expandWildcards?: ExpandWildcards | undefined;
264 lenient?: boolean | undefined;
265 lowercaseExpandedTerms?: boolean | undefined;
266 preference?: string | undefined;
267 q?: string | undefined;
268 routing?: string | string[] | boolean | undefined;
269 scroll?: string | undefined;
270 searchType?: "query_then_fetch" | "dfs_query_then_fetch" | undefined;
271 searchTimeout?: TimeSpan | undefined;
272 size?: number | undefined;
273 sort?: NameList | undefined;
274 _source?: NameList | undefined;
275 _sourceExclude?: NameList | undefined;
276 _sourceInclude?: NameList | undefined;
277 terminateAfter?: number | undefined;
278 stats?: string | string[] | boolean | undefined;
279 version?: number | undefined;
280 requestCache?: boolean | undefined;
281 refresh?: Refresh | undefined;
282 timeout?: TimeSpan | undefined;
283 waitForActiveShards?: string | undefined;
284 scrollSize?: number | undefined;
285 waitForCompletion?: boolean | undefined;
286 requestsPerSecond?: number | undefined;
287 slices?: number | undefined;
288 index?: string | undefined;
289 type?: string | undefined;
290}
291
292export interface DeleteDocumentByQueryResponse extends ReindexResponse {
293 // DeleteDocumentByQueryResponse, UpdateDocumentByQueryResponse and ReindexResponse are identical
294}
295
296export interface DeleteScriptParams extends GenericParams {
297 id: string;
298 lang: string;
299}
300
301export interface DeleteTemplateParams extends GenericParams {
302 id: string;
303}
304
305export interface ExistsParams extends GenericParams {
306 parent?: string | undefined;
307 preference?: string | undefined;
308 realtime?: boolean | undefined;
309 refresh?: boolean | undefined;
310 routing?: string | undefined;
311 id: string;
312 index: string;
313 type: string;
314}
315
316export interface ExplainParams extends GenericParams {
317 analyzeWildcard?: boolean | undefined;
318 analyzer?: string | undefined;
319 defaultOperator?: DefaultOperator | undefined;
320 df?: string | undefined;
321 storedFields?: NameList | undefined;
322 lenient?: boolean | undefined;
323 lowercaseExpandedTerms?: boolean | undefined;
324 parent?: string | undefined;
325 preference?: string | undefined;
326 q?: string | undefined;
327 routing?: string | undefined;
328 _source?: NameList | undefined;
329 _sourceExclude?: NameList | undefined;
330 _sourceInclude?: NameList | undefined;
331 id?: string | undefined;
332 index?: string | undefined;
333 type?: string | undefined;
334}
335
336export interface ExplainResponse {
337 _index: string;
338 _type: string;
339 _id: string;
340 matched: boolean;
341 explanation: ExplainResponseDetails;
342}
343
344export interface ExplainResponseDetails {
345 value: number;
346 description: string;
347 details: ExplainResponseDetails[];
348}
349
350export interface FieldStatsParams extends GenericParams {
351 fields?: NameList | undefined;
352 level?: "indices" | "cluster" | undefined;
353 ignoreUnavailable?: boolean | undefined;
354 allowNoIndices?: boolean | undefined;
355 expandWildcards?: ExpandWildcards | undefined;
356 index?: NameList | undefined;
357}
358
359export interface FieldStatsResponse {
360 _shards: ShardsResponse;
361 indices: { [indexName: string]: FieldStatsResponseIndex };
362 conflicts?: { [fieldName: string]: string } | undefined;
363}
364
365export interface FieldStatsResponseIndex {
366 fields: { [fieldName: string]: FieldStatsResponseField };
367}
368
369export interface FieldStatsResponseField {
370 max_doc: number;
371 doc_count: number;
372 density: number;
373 sum_doc_freq: number;
374 sum_total_term_freq: number;
375 min_value: any;
376 max_value: any;
377 is_searchable: string;
378 is_aggregatable: string;
379}
380
381export interface GetParams extends GenericParams {
382 storedFields?: NameList | undefined;
383 parent?: string | undefined;
384 preference?: string | undefined;
385 realtime?: boolean | undefined;
386 refresh?: boolean | undefined;
387 routing?: string | undefined;
388 _source?: NameList | undefined;
389 _sourceExclude?: NameList | undefined;
390 _sourceInclude?: NameList | undefined;
391 version?: number | undefined;
392 versionType?: VersionType | undefined;
393 id: string;
394 index: string;
395 type: string;
396}
397
398export interface GetResponse<T> {
399 _index: string;
400 _type: string;
401 _id: string;
402 _version: number;
403 _routing?: string | undefined;
404 found: boolean;
405 _source: T;
406}
407
408export interface GetScriptParams extends GenericParams {
409 id: string;
410 lang: string;
411}
412
413export interface GetSourceParams extends GenericParams {
414 preference?: string | undefined;
415 realtime?: boolean | undefined;
416 refresh?: boolean | undefined;
417 routing?: string | undefined;
418 _source: NameList;
419 _sourceExclude?: NameList | undefined;
420 _sourceInclude?: NameList | undefined;
421 version?: number | undefined;
422 versionType?: VersionType | undefined;
423 id: string;
424 index: string;
425 type: string;
426}
427
428export interface GetTemplateParams extends GenericParams {
429 id: string;
430}
431
432export interface IndexDocumentParams<T> extends GenericParams {
433 waitForActiveShards?: string | undefined;
434 opType?: "index" | "create" | undefined;
435 parent?: string | undefined;
436 refresh?: Refresh | undefined;
437 routing?: string | undefined;
438 timeout?: TimeSpan | undefined;
439 timestamp?: Date | number | undefined;
440 ttl?: TimeSpan | undefined;
441 version?: number | undefined;
442 versionType?: VersionType | undefined;
443 pipeline?: string | undefined;
444 id?: string | undefined;
445 index: string;
446 type: string;
447 body: T;
448}
449
450export interface InfoParams extends GenericParams {
451}
452
453export interface MGetParams extends GenericParams {
454 storedFields?: NameList | undefined;
455 preference?: string | undefined;
456 realtime?: boolean | undefined;
457 refresh?: boolean | undefined;
458 routing?: string | undefined;
459 _source?: NameList | undefined;
460 _sourceExclude?: NameList | undefined;
461 _sourceInclude?: NameList | undefined;
462 index?: string | undefined;
463 type?: string | undefined;
464}
465
466export interface MGetResponse<T> {
467 docs?: Array<GetResponse<T>> | undefined;
468}
469
470export interface MSearchParams extends GenericParams {
471 search_type?: "query_then_fetch" | "query_and_fetch" | "dfs_query_then_fetch" | "dfs_query_and_fetch" | undefined;
472 maxConcurrentSearches?: number | undefined;
473 index?: NameList | undefined;
474 type?: NameList | undefined;
475}
476
477export interface MSearchResponse<T> {
478 responses?: Array<SearchResponse<T>> | undefined;
479}
480
481export interface MSearchTemplateParams extends GenericParams {
482 search_type?: "query_then_fetch" | "query_and_fetch" | "dfs_query_then_fetch" | "dfs_query_and_fetch" | undefined;
483 index?: NameList | undefined;
484 type?: NameList | undefined;
485}
486
487export interface MTermVectorsParams extends GenericParams {
488 ids?: NameList | undefined;
489 termStatistics?: boolean | undefined;
490 fieldStatistics?: boolean | undefined;
491 fields?: NameList | undefined;
492 offsets?: boolean | undefined;
493 positions?: boolean | undefined;
494 payloads?: boolean | undefined;
495 preference?: string | undefined;
496 routing?: string | undefined;
497 parent?: string | undefined;
498 realtime?: boolean | undefined;
499 version?: number | undefined;
500 versionType?: VersionType | undefined;
501 index: string;
502 type: string;
503}
504
505export interface PingParams extends GenericParams {
506}
507
508export interface PutScriptParams extends GenericParams {
509 id: string;
510 lang: string;
511 body: any;
512}
513
514export interface PutTemplateParams extends GenericParams {
515 id: string;
516 body: any;
517}
518
519export interface ReindexParams extends GenericParams {
520 refresh?: boolean | undefined;
521 timeout?: TimeSpan | undefined;
522 waitForActiveShards?: string | undefined;
523 waitForCompletion?: boolean | undefined;
524 requestsPerSecond?: number | undefined;
525 slices?: number | undefined;
526 body: {
527 conflicts?: string | undefined;
528 source: {
529 index: string | string[];
530 type?: string | string[] | undefined;
531 query?: any;
532 sort?: any;
533 size?: number | undefined;
534 remote?: {
535 host: string;
536 username?: string | undefined;
537 password?: string | undefined;
538 } | undefined
539 };
540 dest: {
541 index: string;
542 version_type?: string | undefined;
543 op_type?: string | undefined;
544 routing?: string | undefined;
545 pipeline?: string | undefined;
546 };
547 script?: {
548 inline: string;
549 lang: string;
550 } | undefined
551 };
552}
553
554export interface ReindexRethrottleParams extends GenericParams {
555 requestsPerSecond: number;
556 taskId: string;
557}
558
559export interface RenderSearchTemplateParams extends GenericParams {
560 id: string;
561}
562
563export interface ScrollParams extends GenericParams {
564 scroll: TimeSpan;
565 scrollId: string;
566}
567
568export interface SearchParams extends GenericParams {
569 analyzer?: string | undefined;
570 analyzeWildcard?: boolean | undefined;
571 defaultOperator?: DefaultOperator | undefined;
572 df?: string | undefined;
573 explain?: boolean | undefined;
574 storedFields?: NameList | undefined;
575 docvalueFields?: NameList | undefined;
576 fielddataFields?: NameList | undefined;
577 from?: number | undefined;
578 ignoreUnavailable?: boolean | undefined;
579 allowNoIndices?: boolean | undefined;
580 expandWildcards?: ExpandWildcards | undefined;
581 lenient?: boolean | undefined;
582 lowercaseExpandedTerms?: boolean | undefined;
583 preference?: string | undefined;
584 q?: string | undefined;
585 routing?: NameList | undefined;
586 scroll?: TimeSpan | undefined;
587 searchType?: "query_then_fetch" | "dfs_query_then_fetch" | undefined;
588 size?: number | undefined;
589 sort?: NameList | undefined;
590 _source?: NameList | undefined;
591 _sourceExclude?: NameList | undefined;
592 _sourceInclude?: NameList | undefined;
593 terminateAfter?: number | undefined;
594 stats?: NameList | undefined;
595 suggestField?: string | undefined;
596 suggestMode?: "missing" | "popular" | "always" | undefined;
597 suggestSize?: number | undefined;
598 suggestText?: string | undefined;
599 timeout?: TimeSpan | undefined;
600 trackScores?: boolean | undefined;
601 version?: boolean | undefined;
602 requestCache?: boolean | undefined;
603 index?: NameList | undefined;
604 type?: NameList | undefined;
605}
606
607export interface SearchResponse<T> {
608 took: number;
609 timed_out: boolean;
610 _scroll_id?: string | undefined;
611 _shards: ShardsResponse;
612 hits: {
613 total: number;
614 max_score: number;
615 hits: Array<{
616 _index: string;
617 _type: string;
618 _id: string;
619 _score: number;
620 _source: T;
621 _version?: number | undefined;
622 _explanation?: Explanation | undefined;
623 fields?: any;
624 highlight?: any;
625 inner_hits?: any;
626 matched_queries?: string[] | undefined;
627 sort?: string[] | undefined;
628 }>;
629 };
630 aggregations?: any;
631}
632
633export interface SearchShardsParams extends GenericParams {
634 preference?: string | undefined;
635 routing?: string | undefined;
636 local?: boolean | undefined;
637 ignoreUnavailable?: boolean | undefined;
638 allowNoIndices?: boolean | undefined;
639 expandWildcards?: ExpandWildcards | undefined;
640 index: NameList;
641 type?: NameList;
642}
643
644export interface SearchShardsResponse {
645 nodes: any;
646 shards: SearchShardsResponseShard[][];
647}
648
649export interface SearchShardsResponseShard {
650 index: string;
651 node: string;
652 primary: boolean;
653 shard: number;
654 state: string;
655 allocation_id: {
656 id: string;
657 };
658 relocating_node: any;
659}
660
661export interface SearchTemplateParams extends GenericParams {
662 ignoreUnavailable?: boolean | undefined;
663 allowNoIndices?: boolean | undefined;
664 expandWildcards?: ExpandWildcards | undefined;
665 preference?: string | undefined;
666 routing?: NameList | undefined;
667 scroll?: TimeSpan | undefined;
668 searchType?: "query_then_fetch" | "query_and_fetch" | "dfs_query_then_fetch" | "dfs_query_and_fetch" | undefined;
669 index: NameList;
670 type: NameList;
671}
672
673export interface SuggestParams extends GenericParams {
674 ignoreUnavailable?: boolean | undefined;
675 allowNoIndices?: boolean | undefined;
676 expandWildcards?: ExpandWildcards | undefined;
677 preference?: string | undefined;
678 routing?: string | undefined;
679 index: NameList;
680}
681
682export interface TermvectorsParams extends GenericParams {
683 termStatistics?: boolean | undefined;
684 fieldStatistics?: boolean | undefined;
685 fields?: NameList | undefined;
686 offsets?: boolean | undefined;
687 positions?: boolean | undefined;
688 payloads?: boolean | undefined;
689 preference?: string | undefined;
690 routing?: string | undefined;
691 parent?: string | undefined;
692 realtime?: boolean | undefined;
693 version?: number | undefined;
694 versionType?: VersionType | undefined;
695 index: string;
696 type: string;
697 id?: string | undefined;
698}
699
700export interface UpdateDocumentParams extends GenericParams {
701 waitForActiveShards?: string | undefined;
702 fields?: NameList | undefined;
703 _source?: NameList | undefined;
704 _sourceExclude?: NameList | undefined;
705 _sourceInclude?: NameList | undefined;
706 lang?: string | undefined;
707 parent?: string | undefined;
708 refresh?: Refresh | undefined;
709 retryOnConflict?: number | undefined;
710 routing?: string | undefined;
711 timeout?: TimeSpan | undefined;
712 timestamp?: Date | number | undefined;
713 ttl?: TimeSpan | undefined;
714 version?: number | undefined;
715 versionType?: "internal" | "force" | undefined;
716 id: string;
717 index: string;
718 type: string;
719}
720
721export interface UpdateDocumentByQueryParams extends GenericParams {
722 analyzer?: string | undefined;
723 analyzeWildcard?: boolean | undefined;
724 defaultOperator?: DefaultOperator | undefined;
725 df?: string | undefined;
726 explain?: boolean | undefined;
727 storedFields?: NameList | undefined;
728 docvalueFields?: NameList | undefined;
729 fielddataFields?: NameList | undefined;
730 from?: number | undefined;
731 ignoreUnavailable?: boolean | undefined;
732 allowNoIndices?: boolean | undefined;
733 conflicts?: Conflicts | undefined;
734 expandWildcards?: ExpandWildcards | undefined;
735 lenient?: boolean | undefined;
736 lowercaseExpandedTerms?: boolean | undefined;
737 pipeline?: string | undefined;
738 preference?: string | undefined;
739 q?: string | undefined;
740 routing?: NameList | undefined;
741 scroll?: TimeSpan | undefined;
742 searchType?: "query_then_fetch" | "dfs_query_then_fetch" | undefined;
743 searchTimeout?: TimeSpan | undefined;
744 size?: number | undefined;
745 sort?: NameList | undefined;
746 _source?: NameList | undefined;
747 _sourceExclude?: NameList | undefined;
748 _sourceInclude?: NameList | undefined;
749 terminateAfter?: number | undefined;
750 stats?: NameList | undefined;
751 suggestField?: string | undefined;
752 suggestMode?: "missing" | "popular" | "always" | undefined;
753 suggestSize?: number | undefined;
754 suggestText?: string | undefined;
755 timeout?: TimeSpan | undefined;
756 trackScores?: boolean | undefined;
757 version?: boolean | undefined;
758 versionType?: boolean | undefined;
759 requestCache?: boolean | undefined;
760 refresh?: boolean | undefined;
761 waitForActiveShards?: string | undefined;
762 scrollSize?: number | undefined;
763 waitForCompletion?: boolean | undefined;
764 requestsPerSecond?: number | undefined;
765 slices?: number | undefined;
766 index: NameList;
767 type: NameList;
768}
769
770export interface UpdateDocumentByQueryResponse extends ReindexResponse {
771 // DeleteDocumentByQueryResponse, UpdateDocumentByQueryResponse and ReindexResponse are identical
772}
773
774export interface ReindexResponse extends ReindexResponseBase {
775 took: number;
776 timed_out: boolean;
777 failures: any[];
778 slices?: ReindexOrByQueryResponseSlice[] | undefined;
779}
780
781export interface ReindexOrByQueryResponseSlice extends ReindexResponseBase {
782 slice_id: number;
783}
784
785export interface ReindexResponseBase {
786 total: number;
787 updated: number;
788 deleted: number;
789 batches: number;
790 version_conflicts: number;
791 noops: number;
792 retries: {
793 bulk: number;
794 search: number;
795 };
796 throttled_millis: number;
797 requests_per_second: number;
798 throttled_until_millis: number;
799}
800
801export interface Cat {
802 aliases(params: CatAliasesParams, callback: (error: any, response: any) => void): void;
803 aliases(params: CatAliasesParams): Promise<any>;
804 allocation(params: CatAllocationParams, callback: (error: any, response: any) => void): void;
805 allocation(params: CatAllocationParams): Promise<any>;
806 count(params: CatCountParams, callback: (error: any, response: any) => void): void;
807 count(params: CatAllocationParams): Promise<any>;
808 fielddata(params: CatFielddataParams, callback: (error: any, response: any) => void): void;
809 fielddata(params: CatFielddataParams): Promise<any>;
810 health(params: CatHealthParams, callback: (error: any, response: any) => void): void;
811 health(params: CatHealthParams): Promise<any>;
812 help(params: CatHelpParams, callback: (error: any, response: any) => void): void;
813 help(params: CatHelpParams): Promise<any>;
814 indices(params: CatIndicesParams, callback: (error: any, response: any) => void): void;
815 indices(params: CatIndicesParams): Promise<any>;
816 master(params: CatCommonParams, callback: (error: any, response: any) => void): void;
817 master(params: CatCommonParams): Promise<any>;
818 nodeattrs(params: CatCommonParams, callback: (error: any, response: any) => void): void;
819 nodeattrs(params: CatCommonParams): Promise<any>;
820 nodes(params: CatCommonParams, callback: (error: any, response: any) => void): void;
821 nodes(params: CatCommonParams): Promise<any>;
822 pendingTasks(params: CatCommonParams, callback: (error: any, response: any) => void): void;
823 pendingTasks(params: CatCommonParams): Promise<any>;
824 plugins(params: CatCommonParams, callback: (error: any, response: any) => void): void;
825 plugins(params: CatCommonParams): Promise<any>;
826 recovery(params: CatRecoveryParams, callback: (error: any, response: any) => void): void;
827 recovery(params: CatRecoveryParams): Promise<any>;
828 repositories(params: CatCommonParams, callback: (error: any, response: any) => void): void;
829 repositories(params: CatCommonParams): Promise<any>;
830 segments(params: CatSegmentsParams, callback: (error: any, response: any) => void): void;
831 segments(params: CatSegmentsParams): Promise<any>;
832 shards(params: CatShardsParams, callback: (error: any, response: any) => void): void;
833 shards(params: CatShardsParams): Promise<any>;
834 snapshots(params: CatSnapshotsParams, callback: (error: any, response: any) => void): void;
835 snapshots(params: CatSnapshotsParams): Promise<any>;
836 tasks(params: CatTasksParams, callback: (error: any, response: any) => void): void;
837 tasks(params: CatTasksParams): Promise<any>;
838 threadPool(params: CatThreadPoolParams, callback: (error: any, response: any) => void): void;
839 threadPool(params: CatThreadPoolParams): Promise<any>;
840}
841
842export type CatBytes = "b" | "k" | "kb" | "m" | "mb" | "g" | "gb" | "t" | "tb" | "p" | "pb";
843
844export interface CatCommonParams extends GenericParams {
845 format: string;
846 local?: boolean | undefined;
847 masterTimeout?: TimeSpan | undefined;
848 h?: NameList | undefined;
849 help?: boolean | undefined;
850 v?: boolean | undefined;
851}
852
853export interface CatAliasesParams extends CatCommonParams {
854 name?: NameList | undefined;
855}
856
857export interface CatAllocationParams extends CatCommonParams {
858 bytes?: CatBytes | undefined;
859 nodeId?: NameList | undefined;
860}
861
862export interface CatCountParams extends CatCommonParams {
863 index?: NameList | undefined;
864}
865
866export interface CatFielddataParams extends CatCommonParams {
867 bytes?: CatBytes | undefined;
868 fields?: NameList | undefined;
869}
870
871export interface CatHealthParams extends CatCommonParams {
872 ts?: boolean | undefined;
873}
874
875export interface CatHelpParams extends GenericParams {
876 help?: boolean | undefined;
877}
878
879export interface CatIndicesParams extends CatCommonParams {
880 bytes?: CatBytes | undefined;
881 health?: "green" | "yellow" | "red" | undefined;
882 pri?: boolean | undefined;
883 index?: NameList | undefined;
884}
885
886export interface CatRecoveryParams extends GenericParams {
887 format: string;
888 bytes?: CatBytes | undefined;
889 masterTimeout?: TimeSpan | undefined;
890 h?: NameList | undefined;
891 help?: boolean | undefined;
892 v?: boolean | undefined;
893}
894
895export interface CatSegmentsParams extends GenericParams {
896 format: string;
897 h?: NameList | undefined;
898 help?: boolean | undefined;
899 v?: boolean | undefined;
900 index?: NameList | undefined;
901}
902
903export interface CatShardsParams extends CatCommonParams {
904 index?: NameList | undefined;
905 bytes?: CatBytes | undefined;
906}
907
908export interface CatSnapshotsParams extends GenericParams {
909 format: string;
910 ignoreUnavailable?: boolean | undefined;
911 masterTimeout?: TimeSpan | undefined;
912 h?: NameList | undefined;
913 help?: boolean | undefined;
914 v?: boolean | undefined;
915 repository?: NameList | undefined;
916}
917
918export interface CatTasksParams extends GenericParams {
919 format: string;
920 nodeId?: NameList | undefined;
921 actions?: NameList | undefined;
922 detailed?: boolean | undefined;
923 parentNode?: string | undefined;
924 parentTask?: number | undefined;
925 h?: NameList | undefined;
926 help?: boolean | undefined;
927 v?: boolean | undefined;
928}
929
930export interface CatThreadPoolParams extends CatCommonParams {
931 size?: "" | "k" | "m" | "g" | "t" | "p" | undefined;
932 threadPoolPatterns?: NameList | undefined;
933}
934
935export interface Cluster {
936 allocationExplain(params: ClusterAllocationExplainParams, callback: (error: any, response: any) => void): void;
937 allocationExplain(params: ClusterAllocationExplainParams): Promise<any>;
938 getSettings(params: ClusterGetSettingsParams, callback: (error: any, response: any) => void): void;
939 getSettings(params: ClusterGetSettingsParams): Promise<any>;
940 health(params: ClusterHealthParams, callback: (error: any, response: any) => void): void;
941 health(params: ClusterHealthParams): Promise<any>;
942 pendingTasks(params: ClusterPendingTasksParams, callback: (error: any, response: any) => void): void;
943 pendingTasks(params: ClusterPendingTasksParams): Promise<any>;
944 putSettings(params: ClusterPutSettingsParams, callback: (error: any, response: any) => void): void;
945 putSettings(params: ClusterPutSettingsParams): Promise<any>;
946 reroute(params: ClusterRerouteParams, callback: (error: any, response: any) => void): void;
947 reroute(params: ClusterRerouteParams): Promise<any>;
948 state(params: ClusterStateParams, callback: (error: any, response: any) => void): void;
949 state(params: ClusterStateParams): Promise<any>;
950 stats(params: ClusterStatsParams, callback: (error: any, response: any) => void): void;
951 stats(params: ClusterStatsParams): Promise<any>;
952}
953
954export interface ClusterAllocationExplainParams extends GenericParams {
955 includeYesDecisions?: boolean | undefined;
956 includeDiskInfo?: boolean | undefined;
957}
958
959export interface ClusterGetSettingsParams extends GenericParams {
960 flatSettings?: boolean | undefined;
961 masterTimeout?: TimeSpan | undefined;
962 timeout?: TimeSpan | undefined;
963 includeDefaults?: boolean | undefined;
964}
965
966export interface ClusterHealthParams extends GenericParams {
967 level?: "cluster" | "indices" | "shards" | undefined;
968 local?: boolean | undefined;
969 masterTimeout?: TimeSpan | undefined;
970 waitForActiveShards?: string | undefined;
971 waitForNodes?: string | undefined;
972 waitForEvents?: "immediate" | "urgent" | "high" | "normal" | "low" | "languid" | undefined;
973 waitForRelocatingShards?: boolean | undefined;
974 waitForStatus?: "green" | "yellow" | "red" | undefined;
975 index?: NameList | undefined;
976}
977
978export interface ClusterPendingTasksParams extends GenericParams {
979 local?: boolean | undefined;
980 masterTimeout?: TimeSpan | undefined;
981}
982
983export interface ClusterPutSettingsParams extends GenericParams {
984 flatSettings?: boolean | undefined;
985 masterTimeout?: TimeSpan | undefined;
986 timeout?: TimeSpan | undefined;
987}
988
989export interface ClusterRerouteParams extends GenericParams {
990 dryRun?: boolean | undefined;
991 explain?: boolean | undefined;
992 retryFailed?: boolean | undefined;
993 metric?: NameList | undefined;
994 masterTimeout?: TimeSpan | undefined;
995 timeout?: TimeSpan | undefined;
996}
997
998export interface ClusterStateParams extends GenericParams {
999 local?: boolean | undefined;
1000 masterTimeout?: TimeSpan | undefined;
1001 flatSettings?: boolean | undefined;
1002 ignoreUnavailable?: boolean | undefined;
1003 allowNoIndices?: boolean | undefined;
1004 expandWildcards?: ExpandWildcards | undefined;
1005 index?: NameList | undefined;
1006 metric?: NameList | undefined;
1007}
1008
1009export interface ClusterStatsParams extends GenericParams {
1010 flatSettings?: boolean | undefined;
1011 human?: boolean | undefined;
1012 timeout?: TimeSpan | undefined;
1013 nodeId?: NameList | undefined;
1014}
1015
1016export class Indices {
1017 analyze(params: IndicesAnalyzeParams, callback: (error: any, response: any, status: any) => void): void;
1018 analyze(params: IndicesAnalyzeParams): Promise<any>;
1019 clearCache(params: IndicesClearCacheParams, callback: (error: any, response: any, status: any) => void): void;
1020 clearCache(params: IndicesClearCacheParams): Promise<any>;
1021 close(params: IndicesCloseParams, callback: (error: any, response: any, status: any) => void): void;
1022 close(params: IndicesCloseParams): Promise<any>;
1023 create(params: IndicesCreateParams, callback: (error: any, response: any, status: any) => void): void;
1024 create(params: IndicesCreateParams): Promise<any>;
1025 delete(params: IndicesDeleteParams, callback: (error: any, response: any, status: any) => void): void;
1026 delete(params: IndicesDeleteParams): Promise<any>;
1027 deleteAlias(params: IndicesDeleteAliasParams, callback: (error: any, response: any, status: any) => void): void;
1028 deleteAlias(params: IndicesDeleteAliasParams): Promise<any>;
1029 deleteTemplate(params: IndicesDeleteTemplateParams, callback: (error: any, response: any, status: any) => void): void;
1030 deleteTemplate(params: IndicesDeleteTemplateParams): Promise<any>;
1031 exists(params: IndicesExistsParams, callback: (error: any, response: boolean, status: any) => void): void;
1032 exists(params: IndicesExistsParams): Promise<boolean>;
1033 existsAlias(params: IndicesExistsAliasParams, callback: (error: any, response: boolean, status: any) => void): void;
1034 existsAlias(params: IndicesExistsAliasParams): Promise<boolean>;
1035 existsTemplate(params: IndicesExistsTemplateParams, callback: (error: any, response: boolean, status: any) => void): void;
1036 existsTemplate(params: IndicesExistsTemplateParams): Promise<boolean>;
1037 existsType(params: IndicesExistsTypeParams, callback: (error: any, response: boolean, status: any) => void): void;
1038 existsType(params: IndicesExistsTypeParams): Promise<boolean>;
1039 flush(params: IndicesFlushParams, callback: (error: any, response: any, status: any) => void): void;
1040 flush(params: IndicesFlushParams): Promise<any>;
1041 flushSynced(params: IndicesFlushSyncedParams, callback: (error: any, response: any, status: any) => void): void;
1042 flushSynced(params: IndicesFlushSyncedParams): Promise<any>;
1043 forcemerge(params: IndicesForcemergeParams, callback: (error: any, response: any, status: any) => void): void;
1044 forcemerge(params: IndicesForcemergeParams): Promise<any>;
1045 get(params: IndicesGetParams, callback: (error: any, response: any, status: any) => void): void;
1046 get(params: IndicesGetParams): Promise<any>;
1047 getAlias(params: IndicesGetAliasParams, callback: (error: any, response: any, status: any) => void): void;
1048 getAlias(params: IndicesGetAliasParams): Promise<any>;
1049 getFieldMapping(params: IndicesGetFieldMappingParams, callback: (error: any, response: any, status: any) => void): void;
1050 getFieldMapping(params: IndicesGetFieldMappingParams): Promise<any>;
1051 getMapping(params: IndicesGetMappingParams, callback: (error: any, response: any, status: any) => void): void;
1052 getMapping(params: IndicesGetMappingParams): Promise<any>;
1053 getSettings(params: IndicesGetSettingsParams, callback: (error: any, response: any, status: any) => void): void;
1054 getSettings(params: IndicesGetSettingsParams): Promise<any>;
1055 getTemplate(params: IndicesGetTemplateParams, callback: (error: any, response: any, status: any) => void): void;
1056 getTemplate(params: IndicesGetTemplateParams): Promise<any>;
1057 getUpgrade(params: IndicesGetUpgradeParams, callback: (error: any, response: any, status: any) => void): void;
1058 getUpgrade(params: IndicesGetUpgradeParams): Promise<any>;
1059 open(params: IndicesOpenParams, callback: (error: any, response: any, status: any) => void): void;
1060 open(params: IndicesOpenParams): Promise<any>;
1061 putAlias(params: IndicesPutAliasParams, callback: (error: any, response: any, status: any) => void): void;
1062 putAlias(params: IndicesPutAliasParams): Promise<any>;
1063 putMapping(params: IndicesPutMappingParams, callback: (error: any, response: any, status: any) => void): void;
1064 putMapping(params: IndicesPutMappingParams): Promise<any>;
1065 putSettings(params: IndicesPutSettingsParams, callback: (error: any, response: any, status: any) => void): void;
1066 putSettings(params: IndicesPutSettingsParams): Promise<any>;
1067 putTemplate(params: IndicesPutTemplateParams, callback: (error: any, response: any) => void): void;
1068 putTemplate(params: IndicesPutTemplateParams): Promise<any>;
1069 recovery(params: IndicesRecoveryParams, callback: (error: any, response: any) => void): void;
1070 recovery(params: IndicesRecoveryParams): Promise<any>;
1071 refresh(params: IndicesRefreshParams, callback: (error: any, response: any) => void): void;
1072 refresh(params: IndicesRefreshParams): Promise<any>;
1073 rollover(params: IndicesRolloverParams, callback: (error: any, response: IndicesRolloverResponse) => void): void;
1074 rollover(params: IndicesRolloverParams): Promise<IndicesRolloverResponse>;
1075 segments(params: IndicesSegmentsParams, callback: (error: any, response: any) => void): void;
1076 segments(params: IndicesSegmentsParams): Promise<any>;
1077 shardStores(params: IndicesShardStoresParams, callback: (error: any, response: any) => void): void;
1078 shardStores(params: IndicesShardStoresParams): Promise<any>;
1079 shrink(params: IndicesShrinkParams, callback: (error: any, response: any) => void): void;
1080 shrink(params: IndicesShrinkParams): Promise<any>;
1081 stats(params: IndicesStatsParams, callback: (error: any, response: any) => void): void;
1082 stats(params: IndicesStatsParams): Promise<any>;
1083 updateAliases(params: IndicesUpdateAliasesParams, callback: (error: any, response: any) => void): void;
1084 updateAliases(params: IndicesUpdateAliasesParams): Promise<any>;
1085 upgrade(params: IndicesUpgradeParams, callback: (error: any, response: any) => void): void;
1086 upgrade(params: IndicesUpgradeParams): Promise<any>;
1087 validateQuery(params: IndicesValidateQueryParams, callback: (error: any, response: any) => void): void;
1088 validateQuery(params: IndicesValidateQueryParams): Promise<any>;
1089}
1090
1091export interface IndicesAnalyzeParams extends GenericParams {
1092 analyzer?: string | undefined;
1093 charFilter?: NameList | undefined;
1094 field?: string | undefined;
1095 filter?: NameList | undefined;
1096 index?: string | undefined;
1097 perferLocal?: boolean | undefined;
1098 text?: NameList | undefined;
1099 tokenizer?: string | undefined;
1100 explain?: boolean | undefined;
1101 attributes?: NameList | undefined;
1102 format?: "" | undefined;
1103}
1104
1105export interface IndicesClearCacheParams extends GenericParams {
1106 fieldData?: boolean | undefined;
1107 fielddata?: boolean | undefined; // yes the docs really have both
1108 fields?: NameList | undefined;
1109 query?: boolean | undefined;
1110 ignoreUnavailable?: boolean | undefined;
1111 allowNoIndices?: boolean | undefined;
1112 expandWildcards?: ExpandWildcards | undefined;
1113 index?: NameList | undefined;
1114 recycler?: boolean | undefined;
1115 request?: boolean | undefined;
1116}
1117
1118export interface IndicesCloseParams extends GenericParams {
1119 timeout?: TimeSpan | undefined;
1120 masterTimeout?: TimeSpan | undefined;
1121 ignoreUnavailable?: boolean | undefined;
1122 allowNoIndices?: boolean | undefined;
1123 expandWildcards?: ExpandWildcards | undefined;
1124 index: NameList;
1125}
1126
1127export interface IndicesCreateParams extends GenericParams {
1128 waitForActiveShards?: string | undefined;
1129 timeout?: TimeSpan | undefined;
1130 masterTimeout?: TimeSpan | undefined;
1131 updateAllTypes?: boolean | undefined;
1132 includeTypeName?: boolean | undefined;
1133 index: string;
1134}
1135
1136export interface IndicesDeleteParams extends GenericParams {
1137 timeout?: TimeSpan | undefined;
1138 masterTimeout?: TimeSpan | undefined;
1139 index: NameList;
1140 ignoreUnavailable?: boolean | undefined;
1141}
1142
1143export interface IndicesDeleteAliasParams extends GenericParams {
1144 timeout?: TimeSpan | undefined;
1145 masterTimeout?: TimeSpan | undefined;
1146 index: NameList;
1147 name: NameList;
1148}
1149
1150export interface IndicesDeleteTemplateParams extends GenericParams {
1151 timeout?: TimeSpan | undefined;
1152 masterTimeout?: TimeSpan | undefined;
1153 name: string;
1154}
1155
1156export interface IndicesExistsParams extends GenericParams {
1157 ignoreUnavailable?: boolean | undefined;
1158 allowNoIndices?: boolean | undefined;
1159 expandWildcards?: ExpandWildcards | undefined;
1160 local?: boolean | undefined;
1161 index: NameList;
1162}
1163
1164export interface IndicesExistsAliasParams extends IndicesExistsParams {
1165 name: NameList;
1166}
1167
1168export interface IndicesExistsTemplateParams extends GenericParams {
1169 timeout?: TimeSpan | undefined;
1170 masterTimeout?: TimeSpan | undefined;
1171 name: NameList;
1172}
1173
1174export interface IndicesExistsTypeParams extends IndicesExistsParams {
1175 type: NameList;
1176}
1177
1178export interface IndicesFlushParams extends GenericParams {
1179 force?: boolean | undefined;
1180 waitIfOngoing?: boolean | undefined;
1181 ignoreUnavailable?: boolean | undefined;
1182 allowNoIndices?: boolean | undefined;
1183 expandWildcards?: ExpandWildcards | undefined;
1184 index: NameList;
1185}
1186
1187export interface IndicesFlushSyncedParams extends GenericParams {
1188 ignoreUnavailable?: boolean | undefined;
1189 allowNoIndices?: boolean | undefined;
1190 expandWildcards?: ExpandWildcards | undefined;
1191 index: NameList;
1192}
1193
1194export interface IndicesForcemergeParams extends GenericParams {
1195 flush?: boolean | undefined;
1196 ignoreUnavailable?: boolean | undefined;
1197 allowNoIndices?: boolean | undefined;
1198 expandWildcards?: ExpandWildcards | undefined;
1199 maxNumSegments?: number | undefined;
1200 onlyExpungeDeletes?: boolean | undefined;
1201 operationThreading?: any; // even the docs don't know what this does
1202 waitForMerge?: boolean | undefined;
1203 index: NameList;
1204}
1205
1206export interface IndicesGetParams extends GenericParams {
1207 local?: boolean | undefined;
1208 ignoreUnavailable?: boolean | undefined;
1209 allowNoIndices?: boolean | undefined;
1210 expandWildcards?: ExpandWildcards | undefined;
1211 flatSettings?: boolean | undefined;
1212 human?: boolean | undefined;
1213 includeDefaults?: boolean | undefined;
1214 index?: NameList | undefined;
1215 feature?: NameList | undefined;
1216 includeTypeName?: boolean | undefined;
1217}
1218
1219export interface IndicesGetAliasParams extends GenericParams {
1220 ignoreUnavailable?: boolean | undefined;
1221 allowNoIndices?: boolean | undefined;
1222 expandWildcards?: ExpandWildcards | undefined;
1223 local?: boolean | undefined;
1224 index?: NameList | undefined;
1225 name?: NameList | undefined;
1226}
1227
1228export interface IndicesGetFieldMappingParams extends GenericParams {
1229 includeDefaults?: boolean | undefined;
1230 ignoreUnavailable?: boolean | undefined;
1231 allowNoIndices?: boolean | undefined;
1232 expandWildcards?: ExpandWildcards | undefined;
1233 local?: boolean | undefined;
1234 index?: NameList | undefined;
1235 type?: NameList | undefined;
1236 fields?: NameList | undefined;
1237 includeTypeName?: boolean | undefined;
1238}
1239
1240export interface IndicesGetMappingParams extends GenericParams {
1241 ignoreUnavailable?: boolean | undefined;
1242 allowNoIndices?: boolean | undefined;
1243 expandWildcards?: ExpandWildcards | undefined;
1244 local?: boolean | undefined;
1245 index?: NameList | undefined;
1246 type?: NameList | undefined;
1247 includeTypeName?: boolean | undefined;
1248}
1249
1250export interface IndicesGetSettingsParams extends GenericParams {
1251 ignoreUnavailable?: boolean | undefined;
1252 allowNoIndices?: boolean | undefined;
1253 expandWildcards?: ExpandWildcards | undefined;
1254 flatSettings?: boolean | undefined;
1255 local?: boolean | undefined;
1256 human?: boolean | undefined;
1257 includeDefaults?: boolean | undefined;
1258 index?: NameList | undefined;
1259 name?: NameList | undefined;
1260}
1261
1262export interface IndicesGetTemplateParams extends GenericParams {
1263 flatSettings?: boolean | undefined;
1264 masterTimeout?: TimeSpan | undefined;
1265 local?: boolean | undefined;
1266 name?: NameList | undefined;
1267 includeTypeName?: boolean | undefined;
1268}
1269
1270export interface IndicesGetUpgradeParams extends GenericParams {
1271 ignoreUnavailable?: boolean | undefined;
1272 allowNoIndices?: boolean | undefined;
1273 expandWildcards?: ExpandWildcards | undefined;
1274 human?: boolean | undefined;
1275 index?: NameList | undefined;
1276}
1277
1278export interface IndicesOpenParams extends GenericParams {
1279 timeout?: TimeSpan | undefined;
1280 masterTimeout?: TimeSpan | undefined;
1281 ignoreUnavailable?: boolean | undefined;
1282 allowNoIndices?: boolean | undefined;
1283 expandWildcards?: ExpandWildcards | undefined;
1284 index?: NameList | undefined;
1285}
1286
1287export interface IndicesPutAliasParams extends GenericParams {
1288 timeout?: TimeSpan | undefined;
1289 masterTimeout?: TimeSpan | undefined;
1290 index?: NameList | undefined;
1291 name: NameList;
1292}
1293
1294export interface IndicesPutMappingParams extends GenericParams {
1295 timeout?: TimeSpan | undefined;
1296 masterTimeout?: TimeSpan | undefined;
1297 ignoreUnavailable?: boolean | undefined;
1298 allowNoIndices?: boolean | undefined;
1299 expandWildcards?: ExpandWildcards | undefined;
1300 updateAllTypes?: boolean | undefined;
1301 index: NameList;
1302 type: string;
1303 includeTypeName?: boolean | undefined;
1304 body: any;
1305}
1306
1307export interface IndicesPutSettingsParams extends GenericParams {
1308 masterTimeout?: TimeSpan | undefined;
1309 preserveExisting?: boolean | undefined;
1310 ignoreUnavailable?: boolean | undefined;
1311 allowNoIndices?: boolean | undefined;
1312 expandWildcards?: ExpandWildcards | undefined;
1313 flatSettings?: boolean | undefined;
1314 index: NameList;
1315 body: any;
1316}
1317
1318export interface IndicesPutTemplateParams extends GenericParams {
1319 order?: number | undefined;
1320 create?: boolean | undefined;
1321 timeout?: TimeSpan | undefined;
1322 masterTimeout?: TimeSpan | undefined;
1323 flatSettings?: boolean | undefined;
1324 name: string;
1325 body: any;
1326 includeTypeName?: boolean | undefined;
1327}
1328
1329export interface IndicesRecoveryParams extends GenericParams {
1330 detailed?: boolean | undefined;
1331 activeOnly?: boolean | undefined;
1332 human?: boolean | undefined;
1333 index: NameList;
1334}
1335
1336export interface IndicesRefreshParams extends GenericParams {
1337 ignoreUnavailable?: boolean | undefined;
1338 allowNoIndices?: boolean | undefined;
1339 expandWildcards?: ExpandWildcards | undefined;
1340 force?: boolean | undefined;
1341 operationThreading?: any; // even the docs don't know what this does
1342 index: NameList;
1343}
1344
1345export interface IndicesRolloverParams extends GenericParams {
1346 timeout?: TimeSpan | undefined;
1347 masterTimeout?: TimeSpan | undefined;
1348 waitForActiveShards?: number | string | undefined;
1349 alias?: string | undefined;
1350 newIndex?: string | undefined;
1351 includeTypeName?: boolean | undefined;
1352}
1353
1354export interface IndicesRolloverResponse {
1355 acknowledged: boolean;
1356 shards_acknowledged: boolean;
1357 old_index: string;
1358 new_index: string;
1359 rolled_over: boolean;
1360 dry_run: boolean;
1361 conditions: { [condition: string]: boolean };
1362}
1363
1364export interface IndicesSegmentsParams extends GenericParams {
1365 ignoreUnavailable?: boolean | undefined;
1366 allowNoIndices?: boolean | undefined;
1367 expandWildcards?: ExpandWildcards | undefined;
1368 human?: boolean | undefined;
1369 operationThreading?: any; // even the docs don't know what this does
1370 verbose?: boolean | undefined;
1371 index: NameList;
1372}
1373
1374export interface IndicesShardStoresParams extends GenericParams {
1375 status?: NameList | undefined;
1376 ignoreUnavailable?: boolean | undefined;
1377 allowNoIndices?: boolean | undefined;
1378 expandWildcards?: ExpandWildcards | undefined;
1379 operationThreading?: any; // even the docs don't know what this does
1380 index: NameList;
1381}
1382
1383export interface IndicesShrinkParams extends GenericParams {
1384 timeout?: TimeSpan | undefined;
1385 masterTimeout?: TimeSpan | undefined;
1386 waitForActiveShards?: string | number | undefined;
1387 index: string;
1388 target: string;
1389}
1390
1391export interface IndicesStatsParams extends GenericParams {
1392 completionFields?: NameList | undefined;
1393 fielddataFields?: NameList | undefined;
1394 fields?: NameList | undefined;
1395 groups?: NameList | undefined;
1396 human?: boolean | undefined;
1397 level?: "cluster" | "indices" | "shards" | undefined;
1398 types?: NameList | undefined;
1399 index: NameList;
1400 metric?: NameList | undefined;
1401}
1402
1403export interface IndicesUpdateAliasesParams extends GenericParams {
1404 timeout?: TimeSpan | undefined;
1405 masterTimeout?: TimeSpan | undefined;
1406 body: {
1407 actions: IndicesUpdateAliasesParamsAction[];
1408 };
1409}
1410
1411export interface IndicesUpdateAliasesParamsAction {
1412 add?: {
1413 index?: string | undefined;
1414 indices?: string[] | undefined;
1415 alias: string;
1416 routing?: string | undefined;
1417 filter?: object | undefined;
1418 } | undefined;
1419 remove?: {
1420 index?: string | undefined;
1421 indices?: string[] | undefined;
1422 alias: string;
1423 } | undefined;
1424 remove_index?: {
1425 index: string;
1426 } | undefined;
1427}
1428
1429export interface IndicesUpgradeParams extends GenericParams {
1430 expandWildcards?: ExpandWildcards | undefined;
1431 ignoreUnavailable?: boolean | undefined;
1432 waitForCompletion?: boolean | undefined;
1433 onlyAncientSegments?: boolean | undefined;
1434 index: NameList;
1435}
1436
1437export interface IndicesValidateQueryParams extends GenericParams {
1438 explain?: boolean | undefined;
1439 ignoreUnavailable?: boolean | undefined;
1440 allowNoIndices?: boolean | undefined;
1441 expandWildcards?: ExpandWildcards | undefined;
1442 operationThreading?: any; // even the docs don't know what this does
1443 q?: string | undefined;
1444 analyzer?: string | undefined;
1445 analyzeWildcard?: boolean | undefined;
1446 defaultOperator?: DefaultOperator | undefined;
1447 df?: string | undefined;
1448 lenient?: boolean | undefined;
1449 lowercaseExpandedTerms?: boolean | undefined;
1450 rewrite?: boolean | undefined;
1451 index: NameList;
1452 type?: NameList | undefined;
1453}
1454
1455export class Ingest {
1456 deletePipeline(params: IngestDeletePipelineParams, callback: (error: any, response: any, status: any) => void): void;
1457 deletePipeline(params: IngestDeletePipelineParams): Promise<any>;
1458 getPipeline(params: IngestGetPipelineParams, callback: (error: any, response: any, status: any) => void): void;
1459 getPipeline(params: IngestGetPipelineParams): Promise<any>;
1460 putPipeline(params: IngestPutPipelineParams, callback: (error: any, response: any, status: any) => void): void;
1461 putPipeline(params: IngestPutPipelineParams): Promise<any>;
1462 simulate(params: IngestSimulateParams, callback: (error: any, response: any, status: any) => void): void;
1463 simulate(params: IngestSimulateParams): Promise<any>;
1464}
1465
1466export interface IngestDeletePipelineParams extends GenericParams {
1467 masterTimeout?: number | undefined;
1468 timeout?: number | undefined;
1469 id: string;
1470}
1471
1472export interface IngestGetPipelineParams extends GenericParams {
1473 masterTimeout?: number | undefined;
1474 id: string;
1475}
1476
1477export interface IngestPutPipelineParams extends GenericParams {
1478 masterTimeout?: number | undefined;
1479 timeout?: number | undefined;
1480 id: string;
1481 body: any;
1482}
1483
1484export interface IngestSimulateParams extends GenericParams {
1485 verbose?: boolean | undefined;
1486 id: string;
1487}
1488
1489export class Nodes {
1490 hotThreads(params: NodesHotThreadsParams, callback: (error: any, response: any, status: any) => void): void;
1491 hotThreads(params: NodesHotThreadsParams): Promise<any>;
1492 info(params: NodesInfoParams, callback: (error: any, response: any, status: any) => void): void;
1493 info(params: NodesInfoParams): Promise<any>;
1494 stats(params: NodesStatsParams, callback: (error: any, response: any, status: any) => void): void;
1495 stats(params: NodesStatsParams): Promise<any>;
1496}
1497
1498export interface NodesHotThreadsParams extends GenericParams {
1499 interval?: TimeSpan | undefined;
1500 snapshots?: number | undefined;
1501 threads?: number | undefined;
1502 ignoreIdleThreads?: boolean | undefined;
1503 type?: "cpu" | "wait" | "blocked" | undefined;
1504 timeout?: TimeSpan | undefined;
1505 nodeId: NameList;
1506}
1507
1508export interface NodesInfoParams extends GenericParams {
1509 flatSettings?: boolean | undefined;
1510 human?: boolean | undefined;
1511 timeout?: TimeSpan | undefined;
1512 nodeId: NameList;
1513 metric?: NameList | undefined;
1514}
1515
1516export interface NodesStatsParams extends GenericParams {
1517 completionFields?: NameList | undefined;
1518 fielddataFields?: NameList | undefined;
1519 fields?: NameList | undefined;
1520 groups?: boolean | undefined;
1521 human?: boolean | undefined;
1522 level?: "indices" | "node" | "shards" | undefined;
1523 types?: NameList | undefined;
1524 timeout?: TimeSpan | undefined;
1525 metric?: NameList | undefined;
1526 indexMetric?: NameList | undefined;
1527 nodeId?: NameList | undefined;
1528}
1529
1530export class Snapshot {
1531 create(params: SnapshotCreateParams, callback: (error: any, response: any, status: any) => void): void;
1532 create(params: SnapshotCreateParams): Promise<any>;
1533 createRepository(params: SnapshotCreateRepositoryParams, callback: (error: any, response: any, status: any) => void): void;
1534 createRepository(params: SnapshotCreateRepositoryParams): Promise<any>;
1535 delete(params: SnapshotDeleteParams, callback: (error: any, response: any, status: any) => void): void;
1536 delete(params: SnapshotDeleteParams): Promise<any>;
1537 deleteRepository(params: SnapshotDeleteRepositoryParams, callback: (error: any, response: any, status: any) => void): void;
1538 deleteRepository(params: SnapshotDeleteRepositoryParams): Promise<any>;
1539 get(params: SnapshotGetParams, callback: (error: any, response: any, status: any) => void): void;
1540 get(params: SnapshotGetParams): Promise<any>;
1541 getRepository(params: SnapshotGetRepositoryParams, callback: (error: any, response: any, status: any) => void): void;
1542 getRepository(params: SnapshotGetRepositoryParams): Promise<any>;
1543 restore(params: SnapshotRestoreParams, callback: (error: any, response: any, status: any) => void): void;
1544 restore(params: SnapshotRestoreParams): Promise<any>;
1545 status(params: SnapshotStatusParams, callback: (error: any, response: any, status: any) => void): void;
1546 status(params: SnapshotStatusParams): Promise<any>;
1547 verifyRepository(params: SnapshotVerifyRepositoryParams, callback: (error: any, response: any, status: any) => void): void;
1548 verifyRepository(params: SnapshotVerifyRepositoryParams): Promise<any>;
1549}
1550
1551export interface SnapshotCreateParams extends GenericParams {
1552 masterTimeout?: TimeSpan | undefined;
1553 waitForCompletion?: boolean | undefined;
1554 repository: string;
1555 snapshot: string;
1556}
1557
1558export interface SnapshotCreateRepositoryParams extends GenericParams {
1559 masterTimeout?: TimeSpan | undefined;
1560 timeout?: TimeSpan | undefined;
1561 verify?: boolean | undefined;
1562 repository: string;
1563}
1564
1565export interface SnapshotDeleteParams extends GenericParams {
1566 masterTimeout?: TimeSpan | undefined;
1567 repository: string;
1568 snapshot: string;
1569}
1570
1571export interface SnapshotDeleteRepositoryParams extends GenericParams {
1572 masterTimeout?: TimeSpan | undefined;
1573 timeout?: TimeSpan | undefined;
1574 repository: string;
1575}
1576
1577export interface SnapshotGetParams extends GenericParams {
1578 masterTimeout?: TimeSpan | undefined;
1579 ignoreUnavailable?: boolean | undefined;
1580 repository: string;
1581 snapshot: NameList;
1582}
1583
1584export interface SnapshotGetRepositoryParams extends GenericParams {
1585 masterTimeout?: TimeSpan | undefined;
1586 local?: boolean | undefined;
1587 repository: NameList;
1588}
1589
1590export interface SnapshotRestoreParams extends GenericParams {
1591 masterTimeout?: TimeSpan | undefined;
1592 waitForCompletion?: boolean | undefined;
1593 repository: string;
1594 snapshot: string;
1595}
1596
1597export interface SnapshotStatusParams extends GenericParams {
1598 masterTimeout?: TimeSpan | undefined;
1599 ignoreUnavailable?: boolean | undefined;
1600 repository: string;
1601 snapshot: NameList;
1602}
1603
1604export interface SnapshotVerifyRepositoryParams extends GenericParams {
1605 masterTimeout?: TimeSpan | undefined;
1606 timeout?: TimeSpan | undefined;
1607 repository: string;
1608}
1609
1610export class Tasks {
1611 cancel(params: TasksCancelParams, callback: (error: any, response: any, status: any) => void): void;
1612 cancel(params: TasksCancelParams): Promise<any>;
1613 get(params: TasksGetParams, callback: (error: any, response: any, status: any) => void): void;
1614 get(params: TasksGetParams): Promise<any>;
1615 list(params: TasksListParams, callback: (error: any, response: any, status: any) => void): void;
1616 list(params: TasksListParams): Promise<any>;
1617}
1618
1619export interface TasksCancelParams extends GenericParams {
1620 nodeId?: NameList | undefined;
1621 actions?: NameList | undefined;
1622 parentNode?: string | undefined;
1623 parentTask?: string | undefined;
1624 taskId?: string | undefined;
1625}
1626
1627export interface TasksGetParams extends GenericParams {
1628 waitForCompletion?: boolean | undefined;
1629 taskId?: string | undefined;
1630}
1631
1632export interface TasksListParams extends GenericParams {
1633 nodeId?: NameList | undefined;
1634 actions?: NameList | undefined;
1635 detailed?: boolean | undefined;
1636 parentNode?: string | undefined;
1637 parentTask?: string | undefined;
1638 waitForCompletion?: boolean | undefined;
1639 groupBy?: "nodes" | "parents" | undefined;
1640}
1641
1642export namespace errors {
1643 class _Abstract extends Error {}
1644 class Generic extends _Abstract {}
1645 class ConnectionFault extends _Abstract {}
1646 class NoConnections extends _Abstract {}
1647 class Serialization extends _Abstract {}
1648 class RequestTypeError extends _Abstract {}
1649
1650 class AuthenticationException extends _Abstract {}
1651 class AuthorizationException extends _Abstract {}
1652 class BadGateway extends _Abstract {}
1653 class BadRequest extends _Abstract {}
1654 class BlockedByWindowsParentalControls extends _Abstract {}
1655 class ClientClosedRequest extends _Abstract {}
1656 class Conflict extends _Abstract {}
1657 class ExpectationFailed extends _Abstract {}
1658 class Forbidden extends _Abstract {}
1659 class GatewayTimeout extends _Abstract {}
1660 class HTTPToHTTPS extends _Abstract {}
1661 class HTTPVersionNotSupported extends _Abstract {}
1662 class ImATeapot extends _Abstract {}
1663 class InternalServerError extends _Abstract {}
1664 class LengthRequired extends _Abstract {}
1665 class MethodNotAllowed extends _Abstract {}
1666 class MovedPermanently extends _Abstract {}
1667 class MultipleChoices extends _Abstract {}
1668 class NotAcceptable extends _Abstract {}
1669 class NotExtended extends _Abstract {}
1670 class NotFound extends _Abstract {}
1671 class NotImplemented extends _Abstract {}
1672 class NotModified extends _Abstract {}
1673 class PaymentRequired extends _Abstract {}
1674 class PermanentRedirect extends _Abstract {}
1675 class PreconditionFailed extends _Abstract {}
1676 class ProxyAuthenticationRequired extends _Abstract {}
1677 class RequestedRangeNotSatisfiable extends _Abstract {}
1678 class RequestEntityTooLarge extends _Abstract {}
1679 class RequestHeaderTooLarge extends _Abstract {}
1680 class RequestTimeout extends _Abstract {}
1681 class RequestURITooLong extends _Abstract {}
1682 class SeeOther extends _Abstract {}
1683 class ServiceUnavailable extends _Abstract {}
1684 class TemporaryRedirect extends _Abstract {}
1685 class TooManyConnectionsFromThisIP extends _Abstract {}
1686 class TooManyRequests extends _Abstract {}
1687 class UnsupportedMediaType extends _Abstract {}
1688 class UpgradeRequired extends _Abstract {}
1689 class UseProxy extends _Abstract {}
1690 class VariantAlsoNegotiates extends _Abstract {}
1691}
1692
\No newline at end of file