diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts index ac1de377124f0..88b141120a904 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts @@ -37,6 +37,7 @@ describe('query builder', () => { }, }, ], + track_total_hits: true, }, from: 0, size: 10, @@ -84,6 +85,7 @@ describe('query builder', () => { }, }, ], + track_total_hits: true, }, from: 0, size: 10, @@ -142,6 +144,7 @@ describe('query builder', () => { }, }, ], + track_total_hits: true, }, from: 0, size: 10, @@ -213,6 +216,7 @@ describe('query builder', () => { }, }, ], + track_total_hits: true, }, from: 0, size: 10, diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/query_strategies.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/query_strategies.ts index f1614cc19e8c8..5c25ff0b99faa 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/query_strategies.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/query_strategies.ts @@ -86,6 +86,9 @@ export function metadataQueryStrategyV2(): MetadataQueryStrategy { }, }, ], + extraBodyProperties: { + track_total_hits: true, + }, queryResponseToHostListResult: ( searchResponse: SearchResponse ): HostListQueryResult => {