mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Ensures jobs from saved searches are cloned in advanced wizard (#26002)
* [ML] Ensures jobs from saved searches are cloned in advanced wizard * [ML] Use useSavedSearch property for setting job created_by
This commit is contained in:
parent
42feaaa5af
commit
1b3d6ae0b3
6 changed files with 24 additions and 10 deletions
|
@ -199,6 +199,7 @@ module
|
|||
query,
|
||||
filters,
|
||||
combinedQuery,
|
||||
usesSavedSearch: (savedSearch.id !== undefined),
|
||||
jobId: '',
|
||||
description: '',
|
||||
jobGroups: [],
|
||||
|
|
|
@ -243,9 +243,13 @@ export function MultiMetricJobServiceProvider() {
|
|||
job.results_index_name = job.job_id;
|
||||
}
|
||||
|
||||
job.custom_settings = {
|
||||
created_by: WIZARD_TYPE.MULTI_METRIC
|
||||
};
|
||||
if (formConfig.usesSavedSearch === false) {
|
||||
// Jobs created from saved searches cannot be cloned in the wizard as the
|
||||
// ML job config holds no reference to the saved search ID.
|
||||
job.custom_settings = {
|
||||
created_by: WIZARD_TYPE.MULTI_METRIC
|
||||
};
|
||||
}
|
||||
|
||||
return job;
|
||||
}
|
||||
|
|
|
@ -197,13 +197,13 @@ module
|
|||
end: 0,
|
||||
overField: undefined,
|
||||
timeField: indexPattern.timeFieldName,
|
||||
// splitField: undefined,
|
||||
influencerFields: [],
|
||||
firstSplitFieldName: undefined,
|
||||
indexPattern: indexPattern,
|
||||
query,
|
||||
filters,
|
||||
combinedQuery,
|
||||
usesSavedSearch: (savedSearch.id !== undefined),
|
||||
jobId: '',
|
||||
description: '',
|
||||
jobGroups: [],
|
||||
|
|
|
@ -276,9 +276,13 @@ export function PopulationJobServiceProvider(Private) {
|
|||
job.results_index_name = job.job_id;
|
||||
}
|
||||
|
||||
job.custom_settings = {
|
||||
created_by: WIZARD_TYPE.POPULATION
|
||||
};
|
||||
if (formConfig.usesSavedSearch === false) {
|
||||
// Jobs created from saved searches cannot be cloned in the wizard as the
|
||||
// ML job config holds no reference to the saved search ID.
|
||||
job.custom_settings = {
|
||||
created_by: WIZARD_TYPE.POPULATION
|
||||
};
|
||||
}
|
||||
|
||||
return job;
|
||||
}
|
||||
|
|
|
@ -199,6 +199,7 @@ module
|
|||
end: 0,
|
||||
timeField: indexPattern.timeFieldName,
|
||||
indexPattern: undefined,
|
||||
usesSavedSearch: (savedSearch.id !== undefined),
|
||||
query,
|
||||
filters,
|
||||
combinedQuery,
|
||||
|
|
|
@ -174,9 +174,13 @@ export function SingleMetricJobServiceProvider() {
|
|||
job.results_index_name = job.job_id;
|
||||
}
|
||||
|
||||
job.custom_settings = {
|
||||
created_by: WIZARD_TYPE.SINGLE_METRIC
|
||||
};
|
||||
if (formConfig.usesSavedSearch === false) {
|
||||
// Jobs created from saved searches cannot be cloned in the wizard as the
|
||||
// ML job config holds no reference to the saved search ID.
|
||||
job.custom_settings = {
|
||||
created_by: WIZARD_TYPE.SINGLE_METRIC
|
||||
};
|
||||
}
|
||||
|
||||
// Use the original es agg type rather than the ML version
|
||||
// e.g. count rather than high_count
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue