Skip to content

Commit

Permalink
fix events count
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski committed Nov 5, 2020
1 parent f08eb51 commit 3358fa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const matrixHistogram: SecuritySolutionFactory<typeof MatrixHistogramQuer
if (myConfig == null) {
throw new Error(`This histogram type ${options.histogramType} is unknown to the server side`);
}
const totalCount = getOr(0, 'hits.total.value', response.rawResponse);
const totalCount = response.rawResponse.hits.total || 0;
const matrixHistogramData = getOr([], myConfig.aggName, response.rawResponse);
const inspect = {
dsl: [inspectStringifyObject(myConfig.buildDsl(options))],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { cloneDeep, getOr, uniq } from 'lodash/fp';
import { cloneDeep, uniq } from 'lodash/fp';

import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants';
import { IEsSearchResponse } from '../../../../../../../../../src/plugins/data/common';
Expand Down Expand Up @@ -36,7 +36,7 @@ export const timelineEventsAll: SecuritySolutionTimelineFactory<TimelineEventsQu
const { fieldRequested, ...queryOptions } = cloneDeep(options);
queryOptions.fields = uniq([...fieldRequested, ...TIMELINE_EVENTS_FIELDS]);
const { activePage, querySize } = options.pagination;
const totalCount = getOr(0, 'hits.total.value', response.rawResponse);
const totalCount = response.rawResponse.hits.total || 0;
const hits = response.rawResponse.hits.hits;
const edges: TimelineEdges[] = hits.map((hit) =>
// @ts-expect-error
Expand Down

0 comments on commit 3358fa7

Please sign in to comment.