From 3a267fed98b7f96d645197d3cb292b76dd7d53e8 Mon Sep 17 00:00:00 2001 From: Jackie Han Date: Mon, 10 Jun 2024 10:05:43 -0700 Subject: [PATCH] fix a MDS related bug on feature anywhere page (#773) * fix a MDS related bug on feature anywhere page Signed-off-by: Jackie Han * adopt custom result index alias change Signed-off-by: Jackie Han --------- Signed-off-by: Jackie Han (cherry picked from commit 75bad74b345f62f02f6d088d7bb59ba9117dd3df) --- public/expressions/helpers.ts | 3 +++ public/expressions/overlay_anomalies.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/expressions/helpers.ts b/public/expressions/helpers.ts index c11ace78..9c655a8b 100644 --- a/public/expressions/helpers.ts +++ b/public/expressions/helpers.ts @@ -52,6 +52,9 @@ export const getAnomalies = async ( } ); } else { + if (!resultIndex.endsWith('*')) { + resultIndex += '*'; + } anomalySummaryResponse = await getClient().post( `..${AD_NODE_API.DETECTOR}/results/_search/${resultIndex}/true/${dataSourceId}`, { diff --git a/public/expressions/overlay_anomalies.ts b/public/expressions/overlay_anomalies.ts index ea701c2c..e55efc48 100644 --- a/public/expressions/overlay_anomalies.ts +++ b/public/expressions/overlay_anomalies.ts @@ -134,7 +134,8 @@ export const overlayAnomaliesFunction = detectorId, startTimeInMillis, endTimeInMillis, - resultIndex + resultIndex, + dataSourceId ); const anomalyLayer = convertAnomaliesToPointInTimeEventsVisLayer( anomalies,