1
1
[[indices-update-settings]]
2
- === Update Indices Settings
2
+ === Update index settings API
3
+ ++++
4
+ <titleabbrev>Update index settings</titleabbrev>
5
+ ++++
3
6
4
- Change specific index level settings in real time.
5
-
6
- The REST endpoint is `/_settings` (to update all indices) or
7
- `{index}/_settings` to update one (or more) indices settings.
8
- The body of the request includes the updated settings, for example:
7
+ Changes an <<index-modules-settings,index setting>> in real time.
9
8
10
9
[source,js]
11
10
--------------------------------------------------
@@ -19,7 +18,55 @@ PUT /twitter/_settings
19
18
// CONSOLE
20
19
// TEST[setup:twitter]
21
20
22
- To reset a setting back to the default value, use `null`. For example:
21
+
22
+ [[update-index-settings-api-request]]
23
+ ==== {api-request-title}
24
+
25
+ `PUT /<index>/_settings`
26
+
27
+
28
+ [[update-index-settings-api-path-params]]
29
+ ==== {api-path-parms-title}
30
+
31
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
32
+ +
33
+ To update a setting for all indices,
34
+ use `_all` or exclude this parameter.
35
+
36
+
37
+ [[update-index-settings-api-query-params]]
38
+ ==== {api-query-parms-title}
39
+
40
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
41
+
42
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
43
+ +
44
+ Defaults to `open`.
45
+
46
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings]
47
+
48
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
49
+
50
+ `preserve_existing`::
51
+ (Optional, boolean) If `true`, existing index settings remain unchanged.
52
+ Defaults to `false`.
53
+
54
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
55
+
56
+
57
+ [[sample-api-query-params]]
58
+ ==== {api-query-parms-title}
59
+
60
+ `settings`::
61
+ (Optional, <<index-modules-settings,index setting object>>) Configuration
62
+ options for the index. See <<index-modules-settings>>.
63
+
64
+ [[sample-api-example]]
65
+ ==== {api-examples-title}
66
+
67
+ [[reset-index-setting]]
68
+ ===== Reset an index setting
69
+ To revert a setting to the default value, use `null`. For example:
23
70
24
71
[source,js]
25
72
--------------------------------------------------
@@ -38,9 +85,8 @@ indices can be found in <<index-modules>>.
38
85
To preserve existing settings from being updated, the `preserve_existing`
39
86
request parameter can be set to `true`.
40
87
41
- [float]
42
88
[[bulk]]
43
- ==== Bulk Indexing Usage
89
+ ===== Bulk indexing usage
44
90
45
91
For example, the update settings API can be used to dynamically change
46
92
the index from being more performant for bulk indexing, and then move it
@@ -86,16 +132,17 @@ POST /twitter/_forcemerge?max_num_segments=5
86
132
// CONSOLE
87
133
// TEST[continued]
88
134
89
- [float]
90
135
[[update-settings-analysis]]
91
- ==== Updating Index Analysis
136
+ ===== Update index analysis
92
137
93
- It is also possible to define new <<analysis,analyzers>> for the index.
94
- But it is required to <<indices-open-close,close>> the index
95
- first and <<indices-open-close,open>> it after the changes are made.
138
+ You can only define new analyzers on closed indices.
96
139
97
- For example if `content` analyzer hasn't been defined on `myindex` yet
98
- you can use the following commands to add it:
140
+ To add an analyzer,
141
+ you must close the index,
142
+ define the analyzer,
143
+ and reopen the index.
144
+ For example,
145
+ the following commands add the `content` analyzer to `myindex`:
99
146
100
147
[source,js]
101
148
--------------------------------------------------
0 commit comments