Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Ensures jobs from saved searches are cloned in advanced wizard #26002

Merged
merged 2 commits into from
Nov 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ module
query,
filters,
combinedQuery,
usesSavedSearch: (savedSearch.id !== undefined),
jobId: '',
description: '',
jobGroups: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ module
end: 0,
timeField: indexPattern.timeFieldName,
indexPattern: undefined,
usesSavedSearch: (savedSearch.id !== undefined),
query,
filters,
combinedQuery,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down