mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -04:00
Fix branch frozen indices (#29970)
* Adds frozen index param to ES queries * Added include frozen setting to debug output * Updates tests with new request method
This commit is contained in:
parent
beee5f8a0e
commit
674a6aa2ef
3 changed files with 28 additions and 12 deletions
|
@ -40,10 +40,14 @@ interface APMRequestQuery {
|
|||
export function setupRequest(req: Legacy.Request): Setup {
|
||||
const query = (req.query as unknown) as APMRequestQuery;
|
||||
const cluster = req.server.plugins.elasticsearch.getCluster('data');
|
||||
const uiSettings = req.getUiSettingsService();
|
||||
|
||||
const client: ESClient = async (type, params) => {
|
||||
const includeFrozen = await uiSettings.get('search:includeFrozen');
|
||||
|
||||
const client: ESClient = (type, params) => {
|
||||
if (query._debug) {
|
||||
console.log(`DEBUG ES QUERY:`);
|
||||
console.log({ includeFrozen });
|
||||
console.log(
|
||||
`${req.method.toUpperCase()} ${req.url.pathname} ${JSON.stringify(
|
||||
query
|
||||
|
@ -55,6 +59,7 @@ export function setupRequest(req: Legacy.Request): Setup {
|
|||
|
||||
const nextParams = {
|
||||
...params,
|
||||
ignore_throttled: !includeFrozen,
|
||||
rest_total_hits_as_int: true // ensure that ES returns accurate hits.total with pre-6.6 format
|
||||
};
|
||||
return cluster.callWithRequest(req, type, nextParams);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue