From 9cbee5980e2b311f9bac1b43ee1c5a3ca6f9fc87 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Thu, 25 Feb 2021 20:17:05 -0500 Subject: [PATCH] Increase index pattern select limit to 1000 (#92093) (#92733) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- ...ugin-plugins-data-public.indexpatternselectprops.md | 1 + src/plugins/data/public/public.api.md | 1 + .../ui/index_pattern_select/index_pattern_select.tsx | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselectprops.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselectprops.md index 5cfd5e1bc9929..80f4832ba5643 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselectprops.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselectprops.md @@ -12,5 +12,6 @@ export declare type IndexPatternSelectProps = Required void; + maxIndexPatterns?: number; }; ``` diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 471ff93cac386..abfaa8b2e38a0 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -1537,6 +1537,7 @@ export type IndexPatternSelectProps = Required, 'isLo indexPatternId: string; fieldTypes?: string[]; onNoIndexPatterns?: () => void; + maxIndexPatterns?: number; }; // Warning: (ae-missing-release-tag) "IndexPatternSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) diff --git a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx index 96e7a6d83d2d2..aa36323d11bcc 100644 --- a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx @@ -25,6 +25,7 @@ export type IndexPatternSelectProps = Required< indexPatternId: string; fieldTypes?: string[]; onNoIndexPatterns?: () => void; + maxIndexPatterns?: number; }; export type IndexPatternSelectInternalProps = IndexPatternSelectProps & { @@ -41,6 +42,10 @@ interface IndexPatternSelectState { // Needed for React.lazy // eslint-disable-next-line import/no-default-export export default class IndexPatternSelect extends Component { + static defaultProps: { + maxIndexPatterns: 1000; + }; + private isMounted: boolean = false; state: IndexPatternSelectState; @@ -103,7 +108,10 @@ export default class IndexPatternSelect extends Component { const { fieldTypes, onNoIndexPatterns, indexPatternService } = this.props; - const indexPatterns = await indexPatternService.find(`${searchValue}*`, 100); + const indexPatterns = await indexPatternService.find( + `${searchValue}*`, + this.props.maxIndexPatterns + ); // We need this check to handle the case where search results come back in a different // order than they were sent out. Only load results for the most recent search.