Use search:includeFrozen setting in all requests. (#29173)

This commit is contained in:
Sonja Krause-Harder 2019-01-25 10:57:59 +01:00 committed by GitHub
parent dc3a354b3e
commit b256889e14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -35,6 +35,10 @@ declare module 'hapi' {
interface Server {
config: () => KibanaConfig;
}
interface Request {
getUiSettingsService: () => any;
}
}
type KbnMixinFunc = (kbnServer: KbnServer, server: Server, config: any) => Promise<any> | void;

View file

@ -94,7 +94,13 @@ export class InfraKibanaBackendFrameworkAdapter implements InfraBackendFramework
const internalRequest = req[internalInfraFrameworkRequest];
const { elasticsearch } = internalRequest.server.plugins;
const { callWithRequest } = elasticsearch.getCluster('data');
const fields = await callWithRequest(internalRequest, endpoint, params, ...rest);
const includeFrozen = await internalRequest.getUiSettingsService().get('search:includeFrozen');
const fields = await callWithRequest(
internalRequest,
endpoint,
{ ...params, ignore_throttled: !includeFrozen },
...rest
);
return fields;
}