Skip to content

Commit

Permalink
Increase index pattern select limit to 1000 (elastic#92093) (elastic#…
Browse files Browse the repository at this point in the history
…92734)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
Aaron Caldwell and kibanamachine authored Feb 25, 2021
1 parent 26b241d commit 6cb0479
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export declare type IndexPatternSelectProps = Required<Omit<EuiComboBoxProps<any
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};
```
1 change: 1 addition & 0 deletions src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@ export type IndexPatternSelectProps = Required<Omit<EuiComboBoxProps<any>, '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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type IndexPatternSelectProps = Required<
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};

export type IndexPatternSelectInternalProps = IndexPatternSelectProps & {
Expand All @@ -41,6 +42,10 @@ interface IndexPatternSelectState {
// Needed for React.lazy
// eslint-disable-next-line import/no-default-export
export default class IndexPatternSelect extends Component<IndexPatternSelectInternalProps> {
static defaultProps: {
maxIndexPatterns: 1000;
};

private isMounted: boolean = false;
state: IndexPatternSelectState;

Expand Down Expand Up @@ -103,7 +108,10 @@ export default class IndexPatternSelect extends Component<IndexPatternSelectInte

debouncedFetch = _.debounce(async (searchValue: string) => {
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.
Expand Down

0 comments on commit 6cb0479

Please sign in to comment.