Skip to content

Commit 0dec7a4

Browse files
author
Hendrik Muhs
authored
configure auto expand for dataframe indexes (#42924)
creates the dataframe destination index with auto expand for replicas (0-1)
1 parent a2a7b39 commit 0dec7a4

File tree

1 file changed

+3
-1
lines changed
  • x-pack/plugin/data-frame/src/main/java/org/elasticsearch/xpack/dataframe/persistence

1 file changed

+3
-1
lines changed

x-pack/plugin/data-frame/src/main/java/org/elasticsearch/xpack/dataframe/persistence/DataframeIndex.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.elasticsearch.action.admin.indices.create.CreateIndexAction;
1414
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
1515
import org.elasticsearch.client.Client;
16+
import org.elasticsearch.cluster.metadata.IndexMetaData;
1617
import org.elasticsearch.common.settings.Settings;
1718
import org.elasticsearch.common.xcontent.XContentBuilder;
1819
import org.elasticsearch.xpack.core.dataframe.DataFrameField;
@@ -46,7 +47,8 @@ public static void createDestinationIndex(Client client, DataFrameTransformConfi
4647

4748
// TODO: revisit number of shards, number of replicas
4849
request.settings(Settings.builder() // <1>
49-
.put("index.number_of_shards", 1).put("index.number_of_replicas", 0));
50+
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
51+
.put(IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS, "0-1"));
5052

5153
request.mapping(DOC_TYPE, createMappingXContent(mappings,
5254
transformConfig.getPivotConfig().getGroupConfig().getGroups(),

0 commit comments

Comments
 (0)