mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ML] Fixes bucket span estimators loading of max_buckets setting (#59639)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
92cc04c7df
commit
8a4bb61f05
1 changed files with 12 additions and 2 deletions
|
@ -343,11 +343,21 @@ export function estimateBucketSpanFactory(
|
|||
filterPath: '*.*max_buckets',
|
||||
})
|
||||
.then(settings => {
|
||||
if (typeof settings !== 'object' || typeof settings.defaults !== 'object') {
|
||||
if (typeof settings !== 'object') {
|
||||
reject('Unable to retrieve cluster settings');
|
||||
}
|
||||
|
||||
// search.max_buckets could exist in default, persistent or transient cluster settings
|
||||
const maxBucketsSetting = (settings.defaults ||
|
||||
settings.persistent ||
|
||||
settings.transient ||
|
||||
{})['search.max_buckets'];
|
||||
|
||||
if (maxBucketsSetting === undefined) {
|
||||
reject('Unable to retrieve cluster setting search.max_buckets');
|
||||
}
|
||||
|
||||
const maxBuckets = parseInt(settings.defaults['search.max_buckets']);
|
||||
const maxBuckets = parseInt(maxBucketsSetting);
|
||||
|
||||
const runEstimator = (splitFieldValues = []) => {
|
||||
const bucketSpanEstimator = new BucketSpanEstimator(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue