diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts index 287459cf5ec9ac..de28d2eee18050 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts @@ -78,7 +78,7 @@ export const createDetectionIndex = async ( const indexExists = await getIndexExists(callCluster, index); if (indexExists) { const indexVersion = await getIndexVersion(callCluster, index); - if (indexVersion !== SIGNALS_TEMPLATE_VERSION) { + if ((indexVersion ?? 0) < SIGNALS_TEMPLATE_VERSION) { await callCluster('indices.rollover', { alias: index }); } } else { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts index d1b1a2b4dd0eb0..497352b563d366 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts @@ -38,7 +38,7 @@ export const readIndexRoute = (router: IRouter) => { let mappingOutdated: boolean | null = null; try { const indexVersion = await getIndexVersion(clusterClient.callAsCurrentUser, index); - mappingOutdated = indexVersion !== SIGNALS_TEMPLATE_VERSION; + mappingOutdated = (indexVersion ?? 0) < SIGNALS_TEMPLATE_VERSION; } catch (err) { const error = transformError(err); // Some users may not have the view_index_metadata permission necessary to check the index mapping version