Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maps] Handle cross cluster index _settings resp #66797

Merged
merged 1 commit into from
May 15, 2020
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ export function getIndexPatternSettings(indicesSettingsResp) {
maxInnerResultWindow = Math.min(indexMaxInnerResultWindow, indexMaxResultWindow);
});

return { maxResultWindow, maxInnerResultWindow };
return {
maxResultWindow: maxResultWindow === Infinity ? DEFAULT_MAX_RESULT_WINDOW : maxResultWindow,
maxInnerResultWindow:
maxInnerResultWindow === Infinity ? DEFAULT_MAX_INNER_RESULT_WINDOW : maxInnerResultWindow,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ describe('max_result_window and max_inner_result_window are not set', () => {
expect(maxInnerResultWindow).toBe(DEFAULT_MAX_INNER_RESULT_WINDOW);
});

test('Should provide default values from cross cluster index response', () => {
// _settings returns empty object for cross cluster index
const indicesSettingsResp = {};
const { maxResultWindow, maxInnerResultWindow } = getIndexPatternSettings(indicesSettingsResp);
expect(maxResultWindow).toBe(DEFAULT_MAX_RESULT_WINDOW);
expect(maxInnerResultWindow).toBe(DEFAULT_MAX_INNER_RESULT_WINDOW);
});

test('Should include default values when providing minimum values for indices in index pattern', () => {
const indicesSettingsResp = {
kibana_sample_data_logs: {
Expand Down