Add `// NOTCONSOLE` to docs

We have 1074 snippets that look like they should be converted to
`// CONSOLE`. At least that is what `gradle docs:listConsoleCandidates`
says. This adds `// NOTCONSOLE` to explicitly mark snippets that
*shouldn't* be converted to `// CONSOLE`. After marking the blindingly
obvious ones this cuts the remaining snippet count to 1032.
This commit is contained in:
Nik Everett 2016-08-10 18:00:58 -04:00
parent f832eaa6d2
commit ffd226efa0
23 changed files with 73 additions and 19 deletions

View File

@ -42,8 +42,8 @@ public class DocsTestPlugin extends RestTestPlugin {
'List snippets that probably should be marked // CONSOLE' 'List snippets that probably should be marked // CONSOLE'
listConsoleCandidates.perSnippet { listConsoleCandidates.perSnippet {
if ( if (
it.console // Already marked, nothing to do it.console != null // Already marked, nothing to do
|| it.testResponse // It is a response || it.testResponse // It is a response
) { ) {
return return
} }

View File

@ -114,23 +114,38 @@ public class SnippetsTask extends DefaultTask {
return return
} }
if (line ==~ /\/\/\s*AUTOSENSE\s*/) { if (line ==~ /\/\/\s*AUTOSENSE\s*/) {
throw new InvalidUserDataException("AUTOSENSE has been " + throw new InvalidUserDataException("$file:$lineNumber: "
"replaced by CONSOLE. Use that instead at " + + "AUTOSENSE has been replaced by CONSOLE.")
"$file:$lineNumber")
} }
if (line ==~ /\/\/\s*CONSOLE\s*/) { if (line ==~ /\/\/\s*CONSOLE\s*/) {
if (snippet == null) { if (snippet == null) {
throw new InvalidUserDataException("CONSOLE not " + throw new InvalidUserDataException("$file:$lineNumber: "
"paired with a snippet at $file:$lineNumber") + "CONSOLE not paired with a snippet")
}
if (snippet.console != null) {
throw new InvalidUserDataException("$file:$lineNumber: "
+ "Can't be both CONSOLE and NOTCONSOLE")
} }
snippet.console = true snippet.console = true
return return
} }
if (line ==~ /\/\/\s*NOTCONSOLE\s*/) {
if (snippet == null) {
throw new InvalidUserDataException("$file:$lineNumber: "
+ "NOTCONSOLE not paired with a snippet")
}
if (snippet.console != null) {
throw new InvalidUserDataException("$file:$lineNumber: "
+ "Can't be both CONSOLE and NOTCONSOLE")
}
snippet.console = false
return
}
matcher = line =~ /\/\/\s*TEST(\[(.+)\])?\s*/ matcher = line =~ /\/\/\s*TEST(\[(.+)\])?\s*/
if (matcher.matches()) { if (matcher.matches()) {
if (snippet == null) { if (snippet == null) {
throw new InvalidUserDataException("TEST not " + throw new InvalidUserDataException("$file:$lineNumber: "
"paired with a snippet at $file:$lineNumber") + "TEST not paired with a snippet at ")
} }
snippet.test = true snippet.test = true
if (matcher.group(2) != null) { if (matcher.group(2) != null) {
@ -172,8 +187,8 @@ public class SnippetsTask extends DefaultTask {
matcher = line =~ /\/\/\s*TESTRESPONSE(\[(.+)\])?\s*/ matcher = line =~ /\/\/\s*TESTRESPONSE(\[(.+)\])?\s*/
if (matcher.matches()) { if (matcher.matches()) {
if (snippet == null) { if (snippet == null) {
throw new InvalidUserDataException("TESTRESPONSE not " + throw new InvalidUserDataException("$file:$lineNumber: "
"paired with a snippet at $file:$lineNumber") + "TESTRESPONSE not paired with a snippet")
} }
snippet.testResponse = true snippet.testResponse = true
if (matcher.group(2) != null) { if (matcher.group(2) != null) {
@ -226,7 +241,7 @@ public class SnippetsTask extends DefaultTask {
int end = NOT_FINISHED int end = NOT_FINISHED
String contents String contents
boolean console = false Boolean console = null
boolean test = false boolean test = false
boolean testResponse = false boolean testResponse = false
boolean testSetup = false boolean testSetup = false
@ -243,8 +258,8 @@ public class SnippetsTask extends DefaultTask {
if (language != null) { if (language != null) {
result += "($language)" result += "($language)"
} }
if (console) { if (console != null) {
result += '// CONSOLE' result += console ? '// CONSOLE' : '// NOTCONSOLE'
} }
if (test) { if (test) {
result += '// TEST' result += '// TEST'

View File

@ -17,6 +17,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-icu sudo bin/elasticsearch-plugin install analysis-icu
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -31,6 +32,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-icu sudo bin/elasticsearch-plugin remove analysis-icu
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -14,6 +14,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-kuromoji sudo bin/elasticsearch-plugin install analysis-kuromoji
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -28,6 +29,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-kuromoji sudo bin/elasticsearch-plugin remove analysis-kuromoji
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -15,6 +15,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-phonetic sudo bin/elasticsearch-plugin install analysis-phonetic
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -29,6 +30,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-phonetic sudo bin/elasticsearch-plugin remove analysis-phonetic
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -20,6 +20,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-smartcn sudo bin/elasticsearch-plugin install analysis-smartcn
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -34,6 +35,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-smartcn sudo bin/elasticsearch-plugin remove analysis-smartcn
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.
@ -45,4 +47,3 @@ The plugin provides the `smartcn` analyzer and `smartcn_tokenizer` tokenizer,
which are not configurable. which are not configurable.
NOTE: The `smartcn_word` token filter and `smartcn_sentence` have been deprecated. NOTE: The `smartcn_word` token filter and `smartcn_sentence` have been deprecated.

View File

@ -17,6 +17,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-stempel sudo bin/elasticsearch-plugin install analysis-stempel
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -31,6 +32,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-stempel sudo bin/elasticsearch-plugin remove analysis-stempel
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.
@ -40,4 +42,3 @@ The node must be stopped before removing the plugin.
The plugin provides the `polish` analyzer and `polish_stem` token filter, The plugin provides the `polish` analyzer and `polish_stem` token filter,
which are not configurable. which are not configurable.

View File

@ -17,6 +17,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install discovery-azure-classic sudo bin/elasticsearch-plugin install discovery-azure-classic
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -31,6 +32,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove discovery-azure-classic sudo bin/elasticsearch-plugin remove discovery-azure-classic
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -13,6 +13,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install discovery-ec2 sudo bin/elasticsearch-plugin install discovery-ec2
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -27,6 +28,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove discovery-ec2 sudo bin/elasticsearch-plugin remove discovery-ec2
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -13,6 +13,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install discovery-gce sudo bin/elasticsearch-plugin install discovery-gce
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -27,6 +28,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove discovery-gce sudo bin/elasticsearch-plugin remove discovery-gce
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -21,6 +21,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install ingest-attachment sudo bin/elasticsearch-plugin install ingest-attachment
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -35,6 +36,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove ingest-attachment sudo bin/elasticsearch-plugin remove ingest-attachment
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -21,6 +21,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install ingest-geoip sudo bin/elasticsearch-plugin install ingest-geoip
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -35,6 +36,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove ingest-geoip sudo bin/elasticsearch-plugin remove ingest-geoip
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -16,6 +16,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install ingest-user-agent sudo bin/elasticsearch-plugin install ingest-user-agent
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -30,6 +31,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove ingest-user-agent sudo bin/elasticsearch-plugin remove ingest-user-agent
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -15,6 +15,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install lang-javascript sudo bin/elasticsearch-plugin install lang-javascript
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -29,6 +30,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove lang-javascript sudo bin/elasticsearch-plugin remove lang-javascript
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -14,6 +14,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install lang-python sudo bin/elasticsearch-plugin install lang-python
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -28,6 +29,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove lang-python sudo bin/elasticsearch-plugin remove lang-python
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -19,6 +19,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install mapper-attachments sudo bin/elasticsearch-plugin install mapper-attachments
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -33,6 +34,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove mapper-attachments sudo bin/elasticsearch-plugin remove mapper-attachments
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -15,6 +15,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install mapper-murmur3 sudo bin/elasticsearch-plugin install mapper-murmur3
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -29,6 +30,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove mapper-murmur3 sudo bin/elasticsearch-plugin remove mapper-murmur3
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -15,6 +15,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install mapper-size sudo bin/elasticsearch-plugin install mapper-size
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -29,6 +30,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove mapper-size sudo bin/elasticsearch-plugin remove mapper-size
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.
@ -106,4 +108,3 @@ GET my_index/_search
<2> Aggregating on the `_size` field <2> Aggregating on the `_size` field
<3> Sorting on the `_size` field <3> Sorting on the `_size` field
<4> Accessing the `_size` field in scripts (inline scripts must be modules-security-scripting.html#enable-dynamic-scripting[enabled] for this example to work) <4> Accessing the `_size` field in scripts (inline scripts must be modules-security-scripting.html#enable-dynamic-scripting[enabled] for this example to work)

View File

@ -14,6 +14,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install repository-azure sudo bin/elasticsearch-plugin install repository-azure
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -28,6 +29,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove repository-azure sudo bin/elasticsearch-plugin remove repository-azure
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -14,6 +14,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install repository-gcs sudo bin/elasticsearch-plugin install repository-gcs
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
NOTE: The plugin requires new permission to be installed in order to work NOTE: The plugin requires new permission to be installed in order to work
@ -30,6 +31,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove repository-gcs sudo bin/elasticsearch-plugin remove repository-gcs
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -14,6 +14,7 @@ This plugin can be installed through the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install repository-hdfs sudo bin/elasticsearch-plugin install repository-hdfs
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on _every_ node in the cluster, and each node must The plugin must be installed on _every_ node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -28,6 +29,7 @@ The plugin can be removed by specifying the _installed_ package:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove repository-hdfs sudo bin/elasticsearch-plugin remove repository-hdfs
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -14,6 +14,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install repository-s3 sudo bin/elasticsearch-plugin install repository-s3
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -28,6 +29,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove repository-s3 sudo bin/elasticsearch-plugin remove repository-s3
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.

View File

@ -13,6 +13,7 @@ This plugin can be installed using the plugin manager:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin install store-smb sudo bin/elasticsearch-plugin install store-smb
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The plugin must be installed on every node in the cluster, and each node must The plugin must be installed on every node in the cluster, and each node must
be restarted after installation. be restarted after installation.
@ -27,6 +28,7 @@ The plugin can be removed with the following command:
---------------------------------------------------------------- ----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove store-smb sudo bin/elasticsearch-plugin remove store-smb
---------------------------------------------------------------- ----------------------------------------------------------------
// NOTCONSOLE
The node must be stopped before removing the plugin. The node must be stopped before removing the plugin.