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
4 changes: 3 additions & 1 deletion x-pack/plugins/index_management/server/lib/fetch_indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ async function fetchIndicesCall(
const { body: indices } = await client.asCurrentUser.indices.get({
index: indexNamesString,
expand_wildcards: ['hidden', 'all'],
// only get specified properties in the response
Copy link
Copy Markdown
Contributor

@cjcenizal cjcenizal Jan 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuliacech Could you add some more details to this comment to make a note that we want to avoid bloating this response, and that if we include mappings we risk exceeding the 500MB (or whatever it is) limit on Node payloads? The goal we want to achieve is to ensure someone making changes to this code doesn't accidentally reintroduce this bug.

filter_path: ['*.aliases', '*.settings.index.hidden', '*.data_stream'],
});

if (!Object.keys(indices).length) {
Expand Down Expand Up @@ -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