[ML] Fix data visualizer to obtain total hit count as int (#27490) (#27492)

This commit is contained in:
Pete Harverson 2018-12-19 14:21:21 +00:00 committed by Walter Rafelsberger
parent ea47c8f70f
commit 7cc919e067

View file

@ -262,7 +262,12 @@ export class DataVisualizer {
aggs: buildSamplerAggregation(aggs, samplerShardSize)
};
const resp = await this.callWithRequest('search', { index, size, body });
const resp = await this.callWithRequest('search', {
index,
rest_total_hits_as_int: true,
size,
body
});
const aggregations = resp.aggregations;
const totalCount = _.get(resp, ['hits', 'total'], 0);
const stats = {