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

This commit is contained in:
Pete Harverson 2018-12-19 13:42:04 +00:00 committed by GitHub
parent 2bbc821024
commit bfa80411bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 = {