From 62e1d0b31fd36a474dc7ff29a0c05f8560a34f57 Mon Sep 17 00:00:00 2001 From: Xavier Mouligneau Date: Wed, 16 Nov 2022 15:55:18 -0500 Subject: [PATCH] [RAM] Allow more tags in the filter for rule list table (#145413) ## Summary Allow more tags in the filter for the rule list table. This an easy win before creating a specific API to get more tags for the filter an dit will help this [SDH](https://github.com/elastic/sdh-kibana/issues/3281) To make sure that this change won't impact performance we test it the aggregation with GB of data and we did not see any reason to worry about it. (cherry picked from commit b536a16d7be5ce26dcda48e29127d592736cee46) --- x-pack/plugins/alerting/server/rules_client/rules_client.ts | 2 +- .../alerting/server/rules_client/tests/aggregate.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/alerting/server/rules_client/rules_client.ts b/x-pack/plugins/alerting/server/rules_client/rules_client.ts index 811dee819e585..ac1331ab95b62 100644 --- a/x-pack/plugins/alerting/server/rules_client/rules_client.ts +++ b/x-pack/plugins/alerting/server/rules_client/rules_client.ts @@ -1591,7 +1591,7 @@ export class RulesClient { terms: { field: 'alert.attributes.muteAll' }, }, tags: { - terms: { field: 'alert.attributes.tags', order: { _key: 'asc' } }, + terms: { field: 'alert.attributes.tags', order: { _key: 'asc' }, size: 50 }, }, snoozed: { nested: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/aggregate.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/aggregate.test.ts index 494af8f668bfb..937c027ed04ce 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/aggregate.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/aggregate.test.ts @@ -227,7 +227,7 @@ describe('aggregate()', () => { }, }, tags: { - terms: { field: 'alert.attributes.tags', order: { _key: 'asc' } }, + terms: { field: 'alert.attributes.tags', order: { _key: 'asc' }, size: 50 }, }, }, }, @@ -285,7 +285,7 @@ describe('aggregate()', () => { }, }, tags: { - terms: { field: 'alert.attributes.tags', order: { _key: 'asc' } }, + terms: { field: 'alert.attributes.tags', order: { _key: 'asc' }, size: 50 }, }, }, },