Skip to content

Commit 9c574d9

Browse files
committed
Removed Alerting & Event Log deprecated fields that should not be using
1 parent b3706b1 commit 9c574d9

4 files changed

Lines changed: 6 additions & 12 deletions

File tree

x-pack/plugins/actions/server/usage/actions_telemetry.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export async function getTotalCount(callCluster: LegacyAPICaller, kibanaIndex: s
3535

3636
const searchResult = await callCluster('search', {
3737
index: kibanaIndex,
38-
rest_total_hits_as_int: true,
3938
body: {
4039
query: {
4140
bool: {
@@ -104,7 +103,6 @@ export async function getInUseTotalCount(callCluster: LegacyAPICaller, kibanaInd
104103

105104
const actionResults = await callCluster('search', {
106105
index: kibanaIndex,
107-
rest_total_hits_as_int: true,
108106
body: {
109107
query: {
110108
bool: {

x-pack/plugins/alerts/server/usage/alerts_telemetry.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ export async function getTotalCountAggregations(callCluster: LegacyAPICaller, ki
215215

216216
const results = await callCluster('search', {
217217
index: kibanaInex,
218-
rest_total_hits_as_int: true,
219218
body: {
220219
query: {
221220
bool: {
@@ -289,7 +288,6 @@ export async function getTotalCountAggregations(callCluster: LegacyAPICaller, ki
289288
export async function getTotalCountInUse(callCluster: LegacyAPICaller, kibanaInex: string) {
290289
const searchResult: SearchResponse<unknown> = await callCluster('search', {
291290
index: kibanaInex,
292-
rest_total_hits_as_int: true,
293291
body: {
294292
query: {
295293
bool: {

x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ describe('queryEventsBySavedObject', () => {
394394
},
395395
},
396396
"index": "index-name",
397-
"rest_total_hits_as_int": true,
397+
"track_total_hits": true,
398398
}
399399
`);
400400
});
@@ -475,7 +475,7 @@ describe('queryEventsBySavedObject', () => {
475475
},
476476
},
477477
"index": "index-name",
478-
"rest_total_hits_as_int": true,
478+
"track_total_hits": true,
479479
}
480480
`);
481481
});
@@ -589,7 +589,7 @@ describe('queryEventsBySavedObject', () => {
589589
},
590590
},
591591
"index": "index-name",
592-
"rest_total_hits_as_int": true,
592+
"track_total_hits": true,
593593
}
594594
`);
595595
});
@@ -686,7 +686,7 @@ describe('queryEventsBySavedObject', () => {
686686
},
687687
},
688688
"index": "index-name",
689-
"rest_total_hits_as_int": true,
689+
"track_total_hits": true,
690690
}
691691
`);
692692
});

x-pack/plugins/event_log/server/es/cluster_client_adapter.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,13 @@ export class ClusterClientAdapter {
286286
hits: { hits, total },
287287
}: SearchResponse<unknown> = await this.callEs('search', {
288288
index,
289-
// The SearchResponse type only supports total as an int,
290-
// so we're forced to explicitly request that it return as an int
291-
rest_total_hits_as_int: true,
289+
track_total_hits: true,
292290
body,
293291
});
294292
return {
295293
page,
296294
per_page: perPage,
297-
total,
295+
total: ((total as unknown) as { value: number; relation: string }).value || 0,
298296
data: hits.map((hit) => hit._source) as IValidatedEvent[],
299297
};
300298
} catch (err) {

0 commit comments

Comments
 (0)