Skip to content

Commit

Permalink
[Task Manager] Using track_total_hits in workload agg (elastic#99360)
Browse files Browse the repository at this point in the history
* Using track_total_hits in workload agg

* Increasing size of terms aggregation
  • Loading branch information
ymao1 authored and yctercero committed May 11, 2021
1 parent a60474b commit e20741d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('Workload Statistics Aggregator', () => {
expect(taskStore.aggregate).toHaveBeenCalledWith({
aggs: {
taskType: {
terms: { field: 'task.taskType' },
terms: { size: 100, field: 'task.taskType' },
aggs: {
status: {
terms: { field: 'task.status' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function createWorkloadAggregator(
taskStore.aggregate({
aggs: {
taskType: {
terms: { field: 'task.taskType' },
terms: { size: 100, field: 'task.taskType' },
aggs: {
status: {
terms: { field: 'task.status' },
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/task_manager/server/task_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ export class TaskStore {
const { body } = await this.esClient.search<ConcreteTaskInstance>({
index: this.index,
ignore_unavailable: true,
track_total_hits: true,
body: ensureAggregationOnlyReturnsTaskObjects({
query,
aggs,
Expand Down

0 comments on commit e20741d

Please sign in to comment.