Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions x-pack/plugins/index_management/server/lib/fetch_indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ async function fetchIndicesCall(
// This call retrieves alias and settings (incl. hidden status) information about indices
const { body: indices } = await client.asCurrentUser.indices.get({
index: indexNamesString,
expand_wildcards: 'hidden,all',
expand_wildcards: ['hidden', 'all'],
// only get specified properties in the response
filter_path: ['*.aliases', '*.settings.index.hidden', '*.data_stream'],
});

if (!Object.keys(indices).length) {
Expand All @@ -28,7 +30,7 @@ async function fetchIndicesCall(
const { body: catHits } = await client.asCurrentUser.cat.indices({
format: 'json',
h: 'health,status,index,uuid,pri,rep,docs.count,sth,store.size',
expand_wildcards: 'hidden,all',
expand_wildcards: ['hidden', 'all'],
index: indexNamesString,
});

Expand All @@ -53,7 +55,7 @@ async function fetchIndicesCall(
isFrozen: hit.sth === 'true', // sth value coming back as a string from ES
aliases: aliases.length ? aliases : 'none',
// @ts-expect-error @elastic/elasticsearch https://github.com/elastic/elasticsearch-specification/issues/532
hidden: index.settings.index.hidden === 'true',
hidden: index.settings?.index.hidden === 'true',
data_stream: index.data_stream!,
});
}
Expand Down