Browse Source

Docs: Consoleify cluster and indices settings docs (#23030)

relates #23001
Ryan Ernst 8 years ago
parent
commit
c91848e6a7

+ 0 - 2
docs/build.gradle

@@ -93,7 +93,6 @@ buildRestTests.expectedUnconvertedCandidates = [
   'reference/cluster/state.asciidoc',
   'reference/cluster/state.asciidoc',
   'reference/cluster/stats.asciidoc',
   'reference/cluster/stats.asciidoc',
   'reference/cluster/tasks.asciidoc',
   'reference/cluster/tasks.asciidoc',
-  'reference/cluster/update-settings.asciidoc',
   'reference/docs/delete-by-query.asciidoc',
   'reference/docs/delete-by-query.asciidoc',
   'reference/docs/delete.asciidoc',
   'reference/docs/delete.asciidoc',
   'reference/docs/index_.asciidoc',
   'reference/docs/index_.asciidoc',
@@ -111,7 +110,6 @@ buildRestTests.expectedUnconvertedCandidates = [
   'reference/indices/segments.asciidoc',
   'reference/indices/segments.asciidoc',
   'reference/indices/shadow-replicas.asciidoc',
   'reference/indices/shadow-replicas.asciidoc',
   'reference/indices/shard-stores.asciidoc',
   'reference/indices/shard-stores.asciidoc',
-  'reference/indices/update-settings.asciidoc',
   'reference/ingest/ingest-node.asciidoc',
   'reference/ingest/ingest-node.asciidoc',
   'reference/mapping/dynamic/templates.asciidoc',
   'reference/mapping/dynamic/templates.asciidoc',
   'reference/mapping/fields/all-field.asciidoc',
   'reference/mapping/fields/all-field.asciidoc',

+ 30 - 17
docs/reference/cluster/update-settings.asciidoc

@@ -7,23 +7,27 @@ survive a full cluster restart). Here is an example:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XPUT localhost:9200/_cluster/settings -d '{
+PUT /_cluster/settings
+{
     "persistent" : {
     "persistent" : {
-        "discovery.zen.minimum_master_nodes" : 2
+        "indices.recovery.max_bytes_per_sec" : "50mb"
     }
     }
-}'
+}
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
 
 
 Or:
 Or:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XPUT localhost:9200/_cluster/settings -d '{
+PUT /_cluster/settings?flat_settings=true
+{
     "transient" : {
     "transient" : {
-        "discovery.zen.minimum_master_nodes" : 2
+        "indices.recovery.max_bytes_per_sec" : "20mb"
     }
     }
-}'
+}
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
 
 
 The cluster responds with the settings updated. So the response for the
 The cluster responds with the settings updated. So the response for the
 last example will be:
 last example will be:
@@ -31,12 +35,14 @@ last example will be:
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
 {
 {
-    "persistent" : {},
+    ...
+    "persistent" : { },
     "transient" : {
     "transient" : {
-        "discovery.zen.minimum_master_nodes" : "2"
+        "indices.recovery.max_bytes_per_sec" : "20mb"
     }
     }
-}'
+}
 --------------------------------------------------
 --------------------------------------------------
+// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
 
 
 Resetting persistent or transient settings can be done by assigning a
 Resetting persistent or transient settings can be done by assigning a
 `null` value. If a transient setting is reset, the persistent setting
 `null` value. If a transient setting is reset, the persistent setting
@@ -46,12 +52,14 @@ value. Here is an example:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XPUT localhost:9200/_cluster/settings -d '{
+PUT /_cluster/settings
+{
     "transient" : {
     "transient" : {
-        "discovery.zen.minimum_master_nodes" : null
+        "indices.recovery.max_bytes_per_sec" : null
     }
     }
-}'
+}
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
 
 
 Reset settings will not be included in the cluster response. So
 Reset settings will not be included in the cluster response. So
 the response for the last example will be:
 the response for the last example will be:
@@ -59,29 +67,34 @@ the response for the last example will be:
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
 {
 {
+    ...
     "persistent" : {},
     "persistent" : {},
     "transient" : {}
     "transient" : {}
 }
 }
 --------------------------------------------------
 --------------------------------------------------
+// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
 
 
 Settings can also be reset using simple wildcards. For instance to reset
 Settings can also be reset using simple wildcards. For instance to reset
-all dynamic `discovery.zen` setting a prefix can be used:
+all dynamic `indices.recovery` setting a prefix can be used:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XPUT localhost:9200/_cluster/settings -d '{
+PUT /_cluster/settings
+{
     "transient" : {
     "transient" : {
-        "discovery.zen.*" : null
+        "indices.recovery.*" : null
     }
     }
-}'
+}
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
 
 
 Cluster wide settings can be returned using:
 Cluster wide settings can be returned using:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XGET localhost:9200/_cluster/settings
+GET /_cluster/settings
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
 
 
 [float]
 [float]
 === Precedence of settings
 === Precedence of settings

+ 26 - 23
docs/reference/indices/update-settings.asciidoc

@@ -9,25 +9,15 @@ of the request includes the updated settings, for example:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
+PUT /twitter/_settings
 {
 {
     "index" : {
     "index" : {
-        "number_of_replicas" : 4
+        "number_of_replicas" : 2
     }
     }
 }
 }
 --------------------------------------------------
 --------------------------------------------------
-
-The above will change the number of replicas to 4 from the current
-number of replicas. Here is a curl example:
-
-[source,js]
---------------------------------------------------
-curl -XPUT 'localhost:9200/my_index/_settings' -d '
-{
-    "index" : {
-        "number_of_replicas" : 4
-    }
-}'
---------------------------------------------------
+// CONSOLE
+// TEST[setup:twitter]
 
 
 The list of per-index settings which can be updated dynamically on live
 The list of per-index settings which can be updated dynamically on live
 indices can be found in <<index-modules>>.
 indices can be found in <<index-modules>>.
@@ -43,11 +33,15 @@ use:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XPUT localhost:9200/test/_settings -d '{
+PUT /twitter/_settings
+{
     "index" : {
     "index" : {
         "refresh_interval" : "-1"
         "refresh_interval" : "-1"
-    } }'
+    }
+}
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
+// TEST[setup:twitter]
 
 
 (Another optimization option is to start the index without any replicas,
 (Another optimization option is to start the index without any replicas,
 and only later adding them, but that really depends on the use case).
 and only later adding them, but that really depends on the use case).
@@ -57,18 +51,24 @@ the defaults for example):
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XPUT localhost:9200/test/_settings -d '{
+PUT /twitter/_settings
+{
     "index" : {
     "index" : {
         "refresh_interval" : "1s"
         "refresh_interval" : "1s"
-    } }'
+    }
+}
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
+// TEST[continued]
 
 
 And, a force merge should be called:
 And, a force merge should be called:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XPOST 'http://localhost:9200/test/_forcemerge?max_num_segments=5'
+POST /twitter/_forcemerge?max_num_segments=5
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
+// TEST[continued]
 
 
 [float]
 [float]
 [[update-settings-analysis]]
 [[update-settings-analysis]]
@@ -83,9 +83,10 @@ you can use the following commands to add it:
 
 
 [source,js]
 [source,js]
 --------------------------------------------------
 --------------------------------------------------
-curl -XPOST 'localhost:9200/myindex/_close'
+POST /twitter/_close
 
 
-curl -XPUT 'localhost:9200/myindex/_settings' -d '{
+PUT /twitter/_settings
+{
   "analysis" : {
   "analysis" : {
     "analyzer":{
     "analyzer":{
       "content":{
       "content":{
@@ -94,7 +95,9 @@ curl -XPUT 'localhost:9200/myindex/_settings' -d '{
       }
       }
     }
     }
   }
   }
-}'
+}
 
 
-curl -XPOST 'localhost:9200/myindex/_open'
+POST /twitter/_open
 --------------------------------------------------
 --------------------------------------------------
+// CONSOLE
+// TEST[setup:twitter]