Skip to content

Commit

Permalink
Fix es archiver refresh?
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Dec 9, 2021
1 parent 7a2f5c2 commit 3ccb661
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/kbn-es-archiver/src/actions/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
{
Expand Down

0 comments on commit 3ccb661

Please sign in to comment.