Skip to content

Commit

Permalink
Set index pattern limit to 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Caldwell committed Feb 19, 2021
1 parent 99a60ca commit 2d5813f
Showing 1 changed file with 9 additions and 1 deletion.
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 2d5813f

Please sign in to comment.