From ba6599dc2756e41b8d8087b5af40dc2d6933df02 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Wed, 23 Aug 2023 14:02:49 +0200 Subject: [PATCH] support multiple indicies --- .../embeddables/common/anomaly_detection_embeddable.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ml/public/embeddables/common/anomaly_detection_embeddable.ts b/x-pack/plugins/ml/public/embeddables/common/anomaly_detection_embeddable.ts index fa3353644d460..7722238cdbb38 100644 --- a/x-pack/plugins/ml/public/embeddables/common/anomaly_detection_embeddable.ts +++ b/x-pack/plugins/ml/public/embeddables/common/anomaly_detection_embeddable.ts @@ -59,10 +59,10 @@ export abstract class AnomalyDetectionEmbeddable< const indexPatterns: Record = {}; for (const indexName of indices) { const response = await this.dataViewsService.find(`"${indexName}"`); - - const indexPattern = response.find( - (obj) => obj.getIndexPattern().toLowerCase() === indexName.toLowerCase() + const indexPattern = response.find((obj) => + obj.getIndexPattern().toLowerCase().includes(indexName.toLowerCase()) ); + if (indexPattern !== undefined) { indexPatterns[indexPattern.id!] = indexPattern; }