Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handler: async function (request) {
const uiSettings = await request.getUiSettingsService().getAll();
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
const timefield = uiSettings['timelion:es.timefield'];
const body = {
index: uiSettings['es.default_index'],
body: {
aggs: {
maxAgg: {
max: {
field: timefield
}
},
minAgg: {
min: {
field: timefield
}
}
},
size: 0
}
};
handler: async function (request) {
const uiSettings = await request.getUiSettingsService().getAll();
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
const timefield = uiSettings['timelion:es.timefield'];
const body = {
index: uiSettings['es.default_index'],
body: {
aggs: {
maxAgg: {
max: {
field: timefield
}
},
minAgg: {
min: {
field: timefield
}
}
},
size: 0
}
};