Skip to content

Commit a48d525

Browse files
committed
Document that auto_create_index is dynamic (#37903)
We changed the `action.auto_create_index` setting to be a dynamic cluster-level setting in #20274 but today the reference manual indicates that it is still a static node-level setting. This commit addresses this, and clarifies the semantics of patterns that may both permit and forbid the creation of certain indices. Relates #7513, #27026
1 parent 1b4df28 commit a48d525

File tree

1 file changed

+49
-21
lines changed

1 file changed

+49
-21
lines changed

docs/reference/docs/index_.asciidoc

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,55 @@ NOTE: Replica shards may not all be started when an indexing operation success
5656
[[index-creation]]
5757
=== Automatic Index Creation
5858

59-
The index operation automatically creates an index if it has not been
60-
created before (check out the
61-
<<indices-create-index,create index API>> for manually
62-
creating an index), and also automatically creates a
63-
dynamic type mapping for the specific type if one has not yet been
64-
created (check out the <<indices-put-mapping,put mapping>>
65-
API for manually creating a type mapping).
66-
67-
The mapping itself is very flexible and is schema-free. New fields and
68-
objects will automatically be added to the mapping definition of the
69-
type specified. Check out the <<mapping,mapping>>
70-
section for more information on mapping definitions.
71-
72-
Automatic index creation can be disabled by setting
73-
`action.auto_create_index` to `false` in the config file of all nodes.
74-
Automatic mapping creation can be disabled by setting
75-
`index.mapper.dynamic` to `false` per-index as an index setting.
76-
77-
Automatic index creation can include a pattern based white/black list,
78-
for example, set `action.auto_create_index` to `+aaa*,-bbb*,+ccc*,-*` (+
79-
meaning allowed, and - meaning disallowed).
59+
The index operation automatically creates an index if it does not already
60+
exist, and applies any <<indices-templates,index templates>> that are
61+
configured. The index operation also creates a dynamic type mapping for the
62+
specified type if one does not already exist. By default, new fields and
63+
objects will automatically be added to the mapping definition for the specified
64+
type if needed. Check out the <<mapping,mapping>> section for more information
65+
on mapping definitions, and the the <<indices-put-mapping,put mapping>> API for
66+
information about updating type mappings manually.
67+
68+
Automatic index creation is controlled by the `action.auto_create_index`
69+
setting. This setting defaults to `true`, meaning that indices are always
70+
automatically created. Automatic index creation can be permitted only for
71+
indices matching certain patterns by changing the value of this setting to a
72+
comma-separated list of these patterns. It can also be explicitly permitted and
73+
forbidden by prefixing patterns in the list with a `+` or `-`. Finally it can
74+
be completely disabled by changing this setting to `false`.
75+
76+
[source,js]
77+
--------------------------------------------------
78+
PUT _cluster/settings
79+
{
80+
"persistent": {
81+
"action.auto_create_index": "twitter,index10,-index1*,+ind*" <1>
82+
}
83+
}
84+
85+
PUT _cluster/settings
86+
{
87+
"persistent": {
88+
"action.auto_create_index": "false" <2>
89+
}
90+
}
91+
92+
PUT _cluster/settings
93+
{
94+
"persistent": {
95+
"action.auto_create_index": "true" <3>
96+
}
97+
}
98+
--------------------------------------------------
99+
// CONSOLE
100+
101+
<1> Permit only the auto-creation of indices called `twitter`, `index10`, no
102+
other index matching `index1*`, and any other index matching `ind*`. The
103+
patterns are matched in the order in which they are given.
104+
105+
<2> Completely disable the auto-creation of indices.
106+
107+
<3> Permit the auto-creation of indices with any name. This is the default.
80108

81109
[float]
82110
[[index-versioning]]

0 commit comments

Comments
 (0)