From ba8bd8dfbe089c2cb3444efeb38d69665d2a7766 Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Thu, 6 Jun 2019 14:03:49 +0200 Subject: [PATCH] configure auto expand for dataframe indexes (#42924) creates the dataframe destination index with auto expand for replicas (0-1) --- .../xpack/dataframe/persistence/DataframeIndex.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/data-frame/src/main/java/org/elasticsearch/xpack/dataframe/persistence/DataframeIndex.java b/x-pack/plugin/data-frame/src/main/java/org/elasticsearch/xpack/dataframe/persistence/DataframeIndex.java index f97af415028..f4f340bff62 100644 --- a/x-pack/plugin/data-frame/src/main/java/org/elasticsearch/xpack/dataframe/persistence/DataframeIndex.java +++ b/x-pack/plugin/data-frame/src/main/java/org/elasticsearch/xpack/dataframe/persistence/DataframeIndex.java @@ -13,6 +13,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.create.CreateIndexAction; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.client.Client; +import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.dataframe.DataFrameField; @@ -46,7 +47,8 @@ public final class DataframeIndex { // TODO: revisit number of shards, number of replicas request.settings(Settings.builder() // <1> - .put("index.number_of_shards", 1).put("index.number_of_replicas", 0)); + .put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1) + .put(IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS, "0-1")); request.mapping(DOC_TYPE, createMappingXContent(mappings, transformConfig.getPivotConfig().getGroupConfig().getGroups(),