diff --git a/packages/kbn-es-archiver/src/actions/load.ts b/packages/kbn-es-archiver/src/actions/load.ts index c5bea5e29a687..0a318f895deb3 100644 --- a/packages/kbn-es-archiver/src/actions/load.ts +++ b/packages/kbn-es-archiver/src/actions/load.ts @@ -86,15 +86,17 @@ export async function loadAction({ progress.deactivate(); const result = stats.toJSON(); + const indicesWithDocs: string[] = []; for (const [index, { docs }] of Object.entries(result)) { if (docs && docs.indexed > 0) { log.info('[%s] Indexed %d docs into %j', name, docs.indexed, index); + indicesWithDocs.push(index); } } await client.indices.refresh( { - index: '_all', + index: indicesWithDocs.join(','), allow_no_indices: true, }, {