Merge pull request #24104 from deerawan/elasticsearch-updatebyquery-resp

Elasticsearch: Add UpdateDocumentByQueryResponse
This commit is contained in:
Armando Aguirre
2018-03-08 11:17:32 -08:00
committed by GitHub
2 changed files with 45 additions and 2 deletions
@@ -266,6 +266,30 @@ client.search({
}
});
client.updateByQuery({
index: 'myIndex',
type: 'mytype',
}, (error, response) => {
const {
took,
timed_out,
updated,
deleted,
batches,
version_conflicts,
noops,
retries,
throttled_millis,
throttled_until_millis,
total,
failures
} = response;
const { bulk, search } = retries;
// ...
});
client.indices.updateAliases({
body: {
actions: [
+21 -2
View File
@@ -89,8 +89,8 @@ export class Client {
termvectors(params: TermvectorsParams, callback: (error: any, response: any) => void): void;
update(params: UpdateDocumentParams): Promise<any>;
update(params: UpdateDocumentParams, callback: (error: any, response: any) => void): void;
updateByQuery(params: UpdateDocumentByQueryParams): Promise<any>;
updateByQuery(params: UpdateDocumentByQueryParams, callback: (error: any, response: any) => void): void;
updateByQuery(params: UpdateDocumentByQueryParams): Promise<UpdateDocumentByQueryResponse>;
updateByQuery(params: UpdateDocumentByQueryParams, callback: (error: any, response: UpdateDocumentByQueryResponse) => void): void;
close(): void;
}
@@ -785,6 +785,25 @@ export interface UpdateDocumentByQueryParams extends GenericParams {
type: NameList;
}
export interface UpdateDocumentByQueryResponse {
took: number;
timed_out: boolean;
updated: number;
deleted: number;
batches: number;
version_conflicts: number;
noops: number;
retries: {
bulk: number;
search: number;
};
throttled_millis: number;
requests_per_second: number;
throttled_until_millis: number;
total: number;
failures: any[];
}
export interface Cat {
aliases(params: CatAliasesParams, callback: (error: any, response: any) => void): void;
aliases(params: CatAliasesParams): Promise<any>;