<commit_before>[[modules-plugins]]
== Plugins

[float]
=== Plugins

Plugins are a way to enhance the basic elasticsearch functionality in a
custom manner. They range from adding custom mapping types, custom
analyzers (in a more built in fashion), native scripts, custom discovery
and more.

[float]
[[installing]]
==== Installing plugins

Installing plugins can either be done manually by placing them under the
`plugins` directory, or using the `plugin` script. Several plugins can
be found under the https://github.com/elasticsearch[elasticsearch]
organization in GitHub, starting with `elasticsearch-`.

Installing plugins typically take the following form:

[source,shell]
-----------------------------------
plugin --install <org>/<user/component>/<version>
-----------------------------------

The plugins will be
automatically downloaded in this case from `download.elasticsearch.org`,
and in case they don't exist there, from maven (central and sonatype).

Note that when the plugin is located in maven central or sonatype
repository, `<org>` is the artifact `groupId` and `<user/component>` is
the `artifactId`.

A plugin can also be installed directly by specifying the URL for it,
for example:

[source,shell]
-----------------------------------
bin/plugin --url file:///path/to/plugin --install plugin-name
-----------------------------------


You can run `bin/plugin -h`.

[float]
[[site-plugins]]
==== Site Plugins

Plugins can have "sites" in them, any plugin that exists under the
`plugins` directory with a `_site` directory, its content will be
statically served when hitting `/_plugin/[plugin_name]/` url. Those can
be added even after the process has started.

Installed plugins that do not contain any java related content, will
automatically be detected as site plugins, and their content will be
moved under `_site`.

The ability to install plugins from Github allows to easily install site
plugins hosted there by downloading the actual repo, for example,
running:

[source,js]
--------------------------------------------------
bin/plugin --install mobz/elasticsearch-head
bin/plugin --install lukas-vlcek/bigdesk
--------------------------------------------------

Will install both of those site plugins, with `elasticsearch-head`
available under `http://localhost:9200/_plugin/head/` and `bigdesk`
available under `http://localhost:9200/_plugin/bigdesk/`.

[float]
==== Mandatory Plugins

If you rely on some plugins, you can define mandatory plugins using the
`plugin.mandatory` attribute, for example, here is a sample config:

[source,js]
--------------------------------------------------
plugin.mandatory: mapper-attachments,lang-groovy
--------------------------------------------------

For safety reasons, if a mandatory plugin is not installed, the node
will not start.

[float]
==== Installed Plugins

A list of the currently loaded plugins can be retrieved using the
<<cluster-nodes-info,Node Info API>>.

[float]
==== Removing plugins

Removing plugins can either be done manually by removing them under the
`plugins` directory, or using the `plugin` script.

Removing plugins typically take the following form:

[source,shell]
-----------------------------------
plugin --remove <pluginname>
-----------------------------------

[float]
==== Silent/Verbose mode

When running the `plugin` script, you can get more information (debug mode) using `--verbose`.
On the opposite, if you want `plugin` script to be silent, use `--silent` option.

Note that exit codes could be:

* `0`: everything was OK
* `64`: unknown command or incorrect option parameter
* `74`: IO error
* `70`: other errors

[source,shell]
-----------------------------------
bin/plugin --install mobz/elasticsearch-head --verbose
plugin --remove head --silent
-----------------------------------

[float]
==== Timeout settings

By default, the `plugin` script will wait indefinitely when downloading before failing.
The timeout parameter can be used to explicitly specify how long it waits. Here is some examples of setting it to
different values:

[source,shell]
-----------------------------------
# Wait for 30 seconds before failing
bin/plugin --install mobz/elasticsearch-head --timeout 30s

# Wait for 1 minute before failing
bin/plugin --install mobz/elasticsearch-head --timeout 1m

# Wait forever (default)
bin/plugin --install mobz/elasticsearch-head --timeout 0
-----------------------------------

[float]
==== Lucene version dependent plugins

added[1.2.0]

For some plugins, such as analysis plugins, a specific major Lucene version is
required to run. In that case, the plugin provides in its `es-plugin.properties`
file the Lucene version for which the plugin was built for.

If present at startup the node will check the Lucene version before loading the plugin.

You can disable that check using `plugins.check_lucene: false`.

[float]
[[known-plugins]]
=== Known Plugins

[float]<commit_msg>add Proxy setting for using plugin command<commit_after>[[modules-plugins]]
== Plugins

[float]
=== Plugins

Plugins are a way to enhance the basic elasticsearch functionality in a
custom manner. They range from adding custom mapping types, custom
analyzers (in a more built in fashion), native scripts, custom discovery
and more.

[float]
[[installing]]
==== Installing plugins

Installing plugins can either be done manually by placing them under the
`plugins` directory, or using the `plugin` script. Several plugins can
be found under the https://github.com/elasticsearch[elasticsearch]
organization in GitHub, starting with `elasticsearch-`.

Installing plugins typically take the following form:

[source,shell]
-----------------------------------
plugin --install <org>/<user/component>/<version>
-----------------------------------

The plugins will be
automatically downloaded in this case from `download.elasticsearch.org`,
and in case they don't exist there, from maven (central and sonatype).

Note that when the plugin is located in maven central or sonatype
repository, `<org>` is the artifact `groupId` and `<user/component>` is
the `artifactId`.

A plugin can also be installed directly by specifying the URL for it,
for example:

[source,shell]
-----------------------------------
bin/plugin --url file:///path/to/plugin --install plugin-name
-----------------------------------


You can run `bin/plugin -h`.

[float]
[[site-plugins]]
==== Site Plugins

Plugins can have "sites" in them, any plugin that exists under the
`plugins` directory with a `_site` directory, its content will be
statically served when hitting `/_plugin/[plugin_name]/` url. Those can
be added even after the process has started.

Installed plugins that do not contain any java related content, will
automatically be detected as site plugins, and their content will be
moved under `_site`.

The ability to install plugins from Github allows to easily install site
plugins hosted there by downloading the actual repo, for example,
running:

[source,js]
--------------------------------------------------
bin/plugin --install mobz/elasticsearch-head
bin/plugin --install lukas-vlcek/bigdesk
--------------------------------------------------

Will install both of those site plugins, with `elasticsearch-head`
available under `http://localhost:9200/_plugin/head/` and `bigdesk`
available under `http://localhost:9200/_plugin/bigdesk/`.

[float]
==== Mandatory Plugins

If you rely on some plugins, you can define mandatory plugins using the
`plugin.mandatory` attribute, for example, here is a sample config:

[source,js]
--------------------------------------------------
plugin.mandatory: mapper-attachments,lang-groovy
--------------------------------------------------

For safety reasons, if a mandatory plugin is not installed, the node
will not start.

[float]
==== Installed Plugins

A list of the currently loaded plugins can be retrieved using the
<<cluster-nodes-info,Node Info API>>.

[float]
==== Removing plugins

Removing plugins can either be done manually by removing them under the
`plugins` directory, or using the `plugin` script.

Removing plugins typically take the following form:

[source,shell]
-----------------------------------
plugin --remove <pluginname>
-----------------------------------

[float]
==== Silent/Verbose mode

When running the `plugin` script, you can get more information (debug mode) using `--verbose`.
On the opposite, if you want `plugin` script to be silent, use `--silent` option.

Note that exit codes could be:

* `0`: everything was OK
* `64`: unknown command or incorrect option parameter
* `74`: IO error
* `70`: other errors

[source,shell]
-----------------------------------
bin/plugin --install mobz/elasticsearch-head --verbose
plugin --remove head --silent
-----------------------------------

[float]
==== Timeout settings

By default, the `plugin` script will wait indefinitely when downloading before failing.
The timeout parameter can be used to explicitly specify how long it waits. Here is some examples of setting it to
different values:

[source,shell]
-----------------------------------
# Wait for 30 seconds before failing
bin/plugin --install mobz/elasticsearch-head --timeout 30s

# Wait for 1 minute before failing
bin/plugin --install mobz/elasticsearch-head --timeout 1m

# Wait forever (default)
bin/plugin --install mobz/elasticsearch-head --timeout 0
-----------------------------------

[float]
==== Proxy settings

To install a plugin via a proxy, you can pass the proxy details using the environment variables `proxyHost` and `proxyPort`.

On Linux and Mac, here is an example of setting it:

[source,shell]
-----------------------------------
bin/plugin -DproxyHost=host_name -DproxyPort=port_number --install mobz/elasticsearch-head
-----------------------------------

On Windows, here is an example of setting it:

[source,shell]
-----------------------------------
set JAVA_OPTS="-DproxyHost=host_name -DproxyPort=port_number"
bin/plugin --install mobz/elasticsearch-head
-----------------------------------

[float]
==== Lucene version dependent plugins

added[1.2.0]

For some plugins, such as analysis plugins, a specific major Lucene version is
required to run. In that case, the plugin provides in its `es-plugin.properties`
file the Lucene version for which the plugin was built for.

If present at startup the node will check the Lucene version before loading the plugin.

You can disable that check using `plugins.check_lucene: false`.

[float]
[[known-plugins]]
=== Known Plugins

[float]
{'fraction_non_alphanumeric': 0.19445503048780488, 'fraction_numerical': 0.004763719512195122, 'mean_word_length': 2.658766120599512, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1674936', 'n_tokens_mistral': 2613, 'n_tokens_neox': 2547, 'n_words': 1199}