configure auto expand for dataframe indexes (#42924)

creates the dataframe destination index with auto expand for replicas (0-1)
This commit is contained in:
Hendrik Muhs 2019-06-06 14:03:49 +02:00
parent 2c3bd32aff
commit ba8bd8dfbe
1 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.create.CreateIndexAction; import org.elasticsearch.action.admin.indices.create.CreateIndexAction;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.xpack.core.dataframe.DataFrameField; import org.elasticsearch.xpack.core.dataframe.DataFrameField;
@ -46,7 +47,8 @@ public final class DataframeIndex {
// TODO: revisit number of shards, number of replicas // TODO: revisit number of shards, number of replicas
request.settings(Settings.builder() // <1> 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, request.mapping(DOC_TYPE, createMappingXContent(mappings,
transformConfig.getPivotConfig().getGroupConfig().getGroups(), transformConfig.getPivotConfig().getGroupConfig().getGroups(),