From 66075243a52d778bcfbf575a88231f4a3acef0e9 Mon Sep 17 00:00:00 2001 From: Davis McPhee Date: Wed, 5 Jun 2024 21:06:20 -0300 Subject: [PATCH] Ensure _id and _index are defined in EsHitRecord --- .../public/application/main/data_fetching/fetch_esql.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/discover/public/application/main/data_fetching/fetch_esql.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_esql.ts index 0e532e600e5a..ba5b34bcc432 100644 --- a/src/plugins/discover/public/application/main/data_fetching/fetch_esql.ts +++ b/src/plugins/discover/public/application/main/data_fetching/fetch_esql.ts @@ -72,6 +72,9 @@ export function fetchEsql( esqlQueryColumns = table?.columns ?? undefined; esqlHeaderWarning = table.warning ?? undefined; finalData = rows.map((row, idx) => { + row._id = row._id ?? ''; + row._index = row._index ?? ''; + const record: DataTableRecord = { id: String(idx), raw: row as EsHitRecord,