Skip to content

Commit

Permalink
fixed due to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Dec 14, 2020
1 parent a2c987e commit f0f0705
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions x-pack/plugins/event_log/server/es/cluster_client_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import { Subject } from 'rxjs';
import { bufferTime, filter, switchMap } from 'rxjs/operators';
import { reject, isUndefined } from 'lodash';
import { SearchResponse, Client } from 'elasticsearch';
import { Client } from 'elasticsearch';
import type { PublicMethodsOf } from '@kbn/utility-types';
import { Logger, LegacyClusterClient } from 'src/core/server';
import { ESSearchResponse } from '../../../../typings/elasticsearch';
import { EsContext } from '.';
import { IEvent, IValidatedEvent, SAVED_OBJECT_REL_PRIMARY } from '../types';
import { FindOptionsType } from '../event_log_client';
Expand Down Expand Up @@ -284,15 +285,15 @@ export class ClusterClientAdapter {
try {
const {
hits: { hits, total },
}: SearchResponse<unknown> = await this.callEs('search', {
}: ESSearchResponse<unknown, {}> = await this.callEs('search', {
index,
track_total_hits: true,
body,
});
return {
page,
per_page: perPage,
total: ((total as unknown) as { value: number; relation: string }).value || 0,
total: total.value,
data: hits.map((hit) => hit._source) as IValidatedEvent[],
};
} catch (err) {
Expand Down

0 comments on commit f0f0705

Please sign in to comment.