Support system indices being hidden (#120985) (#121007)

Co-authored-by: Josh Dover <doverfake@elastic.co>

Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
Co-authored-by: Josh Dover <doverfake@elastic.co>
This commit is contained in:
Kibana Machine 2021-12-09 17:43:15 -05:00 committed by GitHub
parent 78e74925a6
commit 19e30dd54e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
},
{