mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
This commit is contained in:
parent
61e5a692e9
commit
1038c03bc4
2 changed files with 29 additions and 2 deletions
|
@ -338,7 +338,7 @@ it('uses the scrollId to page all the data', async () => {
|
|||
|
||||
expect(mockDataClient.search).toHaveBeenCalledTimes(1);
|
||||
expect(mockDataClient.search).toBeCalledWith(
|
||||
{ params: { ignore_throttled: true, scroll: '30s', size: 500 } },
|
||||
{ params: { ignore_throttled: undefined, scroll: '30s', size: 500 } },
|
||||
{ strategy: 'es' }
|
||||
);
|
||||
|
||||
|
@ -815,3 +815,30 @@ describe('formulas', () => {
|
|||
expect(csvResult.csv_contains_formulas).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('can override ignoring frozen indices', async () => {
|
||||
const originalGet = uiSettingsClient.get;
|
||||
uiSettingsClient.get = jest.fn().mockImplementation((key): any => {
|
||||
if (key === 'search:includeFrozen') {
|
||||
return true;
|
||||
}
|
||||
return originalGet(key);
|
||||
});
|
||||
|
||||
const generateCsv = new CsvGenerator(
|
||||
createMockJob({}),
|
||||
mockConfig,
|
||||
{ es: mockEsClient, data: mockDataClient, uiSettings: uiSettingsClient },
|
||||
{ searchSourceStart: mockSearchSourceService, fieldFormatsRegistry: mockFieldFormatsRegistry },
|
||||
new CancellationToken(),
|
||||
logger,
|
||||
stream
|
||||
);
|
||||
|
||||
await generateCsv.generateData();
|
||||
|
||||
expect(mockDataClient.search).toBeCalledWith(
|
||||
{ params: { ignore_throttled: false, scroll: '30s', size: 500 } },
|
||||
{ strategy: 'es' }
|
||||
);
|
||||
});
|
||||
|
|
|
@ -94,7 +94,7 @@ export class CsvGenerator {
|
|||
index: index.title,
|
||||
scroll: scrollSettings.duration,
|
||||
size: scrollSettings.size,
|
||||
ignore_throttled: !includeFrozen,
|
||||
ignore_throttled: includeFrozen ? false : undefined, // "true" will cause deprecation warnings logged in ES
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue