diff --git a/build.gradle b/build.gradle index 46f113f010658..e77bcb950f7b0 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ * Side Public License, v 1. */ + import com.avast.gradle.dockercompose.tasks.ComposePull import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin import de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin @@ -16,11 +17,12 @@ import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.info.BuildParams import org.elasticsearch.gradle.plugin.PluginBuildPlugin import org.gradle.plugins.ide.eclipse.model.AccessRule +import org.gradle.plugins.ide.eclipse.model.ProjectDependency import org.gradle.plugins.ide.eclipse.model.SourceFolder import org.gradle.util.DistributionLocator import org.gradle.util.GradleVersion + import static org.elasticsearch.gradle.util.GradleUtils.maybeConfigure -import org.gradle.plugins.ide.eclipse.model.ProjectDependency plugins { id 'lifecycle-base' diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java index b53e621f208ba..30dfbaaed5fb9 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java @@ -72,6 +72,7 @@ import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.MlConfigIndex; import org.elasticsearch.xpack.core.ml.MlMetaIndex; +import org.elasticsearch.xpack.core.ml.MlStatsIndex; import org.elasticsearch.xpack.core.ml.action.CloseJobAction; import org.elasticsearch.xpack.core.ml.action.DeleteCalendarAction; import org.elasticsearch.xpack.core.ml.action.DeleteCalendarEventAction; @@ -142,7 +143,6 @@ import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex; -import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields; import org.elasticsearch.xpack.core.ml.notifications.NotificationsIndex; import org.elasticsearch.xpack.core.template.TemplateUtils; import org.elasticsearch.xpack.ml.action.TransportCloseJobAction; @@ -343,6 +343,8 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN; +import static org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields.RESULTS_INDEX_PREFIX; +import static org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields.STATE_INDEX_PREFIX; public class MachineLearning extends Plugin implements SystemIndexPlugin, AnalysisPlugin, @@ -1074,7 +1076,7 @@ public static boolean allTemplatesInstalled(ClusterState clusterState) { List templateNames = Arrays.asList( NotificationsIndex.NOTIFICATIONS_INDEX, - AnomalyDetectorsIndexFields.STATE_INDEX_PREFIX, + STATE_INDEX_PREFIX, AnomalyDetectorsIndex.jobResultsIndexPrefix()); for (String templateName : templateNames) { allPresent = allPresent && TemplateUtils.checkTemplateExistsAndVersionIsGTECurrentVersion(templateName, clusterState); @@ -1156,6 +1158,17 @@ public static SystemIndexDescriptor getInferenceIndexSecurityDescriptor() { .build(); } + @Override + public Collection getAssociatedIndexPatterns() { + return org.elasticsearch.common.collect.List.of( + RESULTS_INDEX_PREFIX + "*", + STATE_INDEX_PREFIX + "*", + MlStatsIndex.indexPattern(), + ".ml-notifications*", + ".ml-annotations*" + ); + } + @Override public String getFeatureName() { return "machine_learning";