Skip to content

Commit

Permalink
[Index Management] Indices list only load specific index properties f…
Browse files Browse the repository at this point in the history
…rom ES (elastic#123629)

(cherry picked from commit f5e66d6)

# Conflicts:
#	x-pack/plugins/index_management/server/lib/fetch_indices.ts
  • Loading branch information
yuliacech committed Jan 25, 2022
1 parent 1c09399 commit ca1d870
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit ca1d870

Please sign in to comment.