Commit graph

59 commits

Author SHA1 Message Date
Liam Thompson
be6a058a67
[DOCS] Improve/fix documentation on stored scripts (#119921) (#119971)
* Improve/fix documentation on stored scripts

* Update docs/reference/scripting/using.asciidoc

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

* Update docs/reference/scripting/using.asciidoc

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

* Update docs/reference/transform/painless-examples.asciidoc

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
(cherry picked from commit 1e608dc223)

Co-authored-by: Valentin Crettaz <valentin.crettaz@consulthys.com>
2025-01-11 04:17:15 +11:00
Lisa Cawley
ebceb76d49
[DOCS] More links to new API site (#119377) (#119418)
(cherry picked from commit ba8beecdb0)
2024-12-31 20:21:46 +00:00
Liam Thompson
7b39d3db52
Term Stats documentation (#115933) (#116167)
* Term Stats documentation

* Update docs/reference/reranking/learning-to-rank-model-training.asciidoc

Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>

* Fix query example.

---------

Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
(cherry picked from commit 0416812456)

Co-authored-by: Aurélien FOUCRET <aurelien.foucret@gmail.com>
2024-11-04 23:28:12 +11:00
Alexander Spies
e28654f8d2
Aggs: Scripted metric allow list docs (#109635)
* Document new settings
* Mention agg allow list in scripting security doc
2024-07-11 14:27:51 +02:00
Liam Thompson
33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00
Abdon Pijpelink
8469883198
[DOCS] Make it clear that "both" is not a valid value for "script.allowed_types" (#97837) 2023-07-24 10:20:57 +02:00
debadair
777598d602
[DOCS] Remove redirect pages (#88738)
* [DOCS] Remove manual redirects

* [DOCS] Removed refs to modules-discovery-hosts-providers

* [DOCS] Fixed broken internal refs

* Fixing bad cross links in ES book, and adding redirects.asciidoc[] back into docs/reference/index.asciidoc.

* Update docs/reference/search/point-in-time-api.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/setup/restart-cluster.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/sql/endpoints/translate.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/snapshot-restore/restore-snapshot.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update repository-azure.asciidoc

* Update node-tool.asciidoc

* Update repository-azure.asciidoc

---------

Co-authored-by: amyjtechwriter <61687663+amyjtechwriter@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Amy Jonsson <amy.jonsson@elastic.co>
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2023-05-24 12:32:46 +01:00
Emanuil Tolev
9b2c921272
Clarify update scripts docs on doc vs ctx use (#66357) 2023-03-09 08:57:17 -06:00
David Kilfoyle
992344a3fc
[Docs] Fix runtime grok script example (#87851)
* [Docs] Fix runtime grok script example

* Update runtime.asciidoc

Small fix.

* Update runtime.asciidoc

Small fix...

* Update common-script-uses.asciidoc

Small fix.

* Update docs/reference/scripting/common-script-uses.asciidoc

Co-authored-by: Adam Locke <adam.locke@elastic.co>

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2022-07-05 10:53:24 -04:00
Adam Locke
d2e7b4caf5
[DOCS] Add documentation for Painless field API (#83388)
* [DOCS] Add documentation for Painless field API

* Moving content to a new page and incorporating reviewer feedback

* Clarify note

* Incorporating review comments

* Remove Object so as not to confuse it with the object type

* Add section and table for supported mapped field types

* Update table based on review feedback
2022-02-03 15:15:38 -05:00
James Rodewig
3845a41804
[DOCS] Fix stored script example snippet (#83056)
Changes:

* Updates the example Painless script to be valid and aligns it with the example in [How to write a script](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-using.html#script-stored-scripts).
* Adds a hidden snippets to delete the script for cleanup.

Relates to https://github.com/elastic/elasticsearch/issues/83038
2022-01-25 10:30:48 -05:00
Lisa Cawley
0a1851353a
Update using.asciidoc (#81896) (#82097)
Co-authored-by: Majid Alaeinia <11965368+majidalaeinia@users.noreply.github.com>
2021-12-27 12:51:21 -08:00
Stuart Tettemer
808b70d2f9
Script: Restore the scripting general cache (#79453)
Deprecate the script context cache in favor of the general cache.

Users should use the following settings:
`script.max_compilations_rate` to set the max compilation rate
  for user scripts such as filter scripts.  Certain script contexts
  that submit scripts outside of the control of the user are
  exempted from this rate limit.  Examples include runtime fields,
  ingest and watcher.

`script.cache.max_size` to set the max size of the cache.

`script.cache.expire` to set the expiration time for entries in
the cache.

Whats deprecated?
`script.max_compilations_rate: use-context`.  This special
setting value was used to turn on the script context-specific caches.

`script.context.$CONTEXT.cache_max_size`, use `script.cache.max_size`
instead.

`script.context.$CONTEXT.cache_expire`, use `script.cache.expire`
instead.

`script.context.$CONTEXT.max_compilations_rate`, use
`script.max_compilations_rate` instead.

The default cache size was increased from `100` to `3000`, which
was approximately the max cache size when using context-specific caches.

The default compilation rate limit was increased from `75/5m` to
`150/5m` to account for increasing uses of scripts.

System script contexts can now opt-out of compilation rate limiting
using a flag rather than a sentinel rate limit value.

7.16: Script: Deprecate script context cache #79508
Refs: #62899

7.16: Script: Opt-out system contexts from script compilation rate limit #79459
Refs: #62899
2021-10-21 07:57:27 -05:00
Stéphane DERACO
dfc9df8c26
Fix broken link for grok patterns in documentation (#78878)
* Fix broken link for grok patterns in documentation

The current link for grok patterns does not exist anymore:

https://github.com/elastic/elasticsearch/blob/master/libs/grok/src/main/resources/patterns/grok-patterns

I have replaced it with:

https://github.com/elastic/elasticsearch/blob/master/libs/grok/src/main/resources/patterns/ecs-v1/grok-patterns

But I'm unsure if it is the right link as there is also a 'legacy' folder.

* Update link and add section for ECS migration

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2021-10-12 14:46:44 -04:00
Adam Locke
b9ad9860af
[DOCS] Add ES security principles (#76850)
* [DOCS] Add ES security principles

* Incorporating review feedback

* More changes from review feedback

* Fix cross-link to Painless guide

* Clarify callout text

* Add information about elasticsearch user

* Minor wording edits

* Consolidate Java Security Manager description, plus other edits

* Clarify not running as root

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-08-31 12:37:22 -04:00
James Rodewig
fc0ac1923d
[DOCS] Correct spelling for geo terms (#76028)
Changes:
* Use "geopoint" when not referring to the literal field type
* Use "geoshape" when not referring to the literal field type or query type
* Use "GeoJSON" consistently
2021-08-03 09:55:48 -04:00
James Rodewig
3d1cb4944d
[DOCS] Overhaul search template docs (#72583)
Changes:

* Adds a tutorial for search templates.
* Adds reference docs for the render search template API.
* Improves parameter documentation for the multi search template API.
* Removes duplicate examples from the search template API, multi search API, and create stored script API docs.
* Splits the source files for the search template API and the multi search template API docs.
2021-06-30 16:03:49 -04:00
James Rodewig
94d6978abe
[DOCS] Add missing request section for delete stored script API (#74240) 2021-06-17 09:07:32 -04:00
bellengao
6705f9db74
[DOCS] Fix URL of get stored script API (#74221) 2021-06-17 09:03:39 -04:00
Nicole Albee
e124824f22
Replace deprecated script.cache.* settings with script.context.$constext.cache_* in documentation. (#74144) 2021-06-16 09:49:58 -04:00
Adam Locke
88dfe1aebf
[DOCS] Remove errant note (#73597) (#73600) 2021-06-01 09:41:09 -04:00
Adam Locke
e64a029be4
[DOCS] Create a new page for dissect content in scripting docs (#73437)
* [DOCS] Create a new page for dissect in scripting docs

* Expanding a bit more

* Adding a section for using dissect patterns

* Adding tests

* Fix test cases and other edits
2021-05-27 17:08:52 -04:00
Adam Locke
0aa0171ce1
[DOCS] Create a new page for grok content in scripting docs (#73118)
* [DOCS] Moving grok to its own scripting page

* Adding examples

* Updating cross link for grok page

* Adds same runtime field in a search request for #73262

* Clarify titles and shift navigation

* Incorporating review feedback

* Updating cross-link to Painless
2021-05-27 15:18:34 -04:00
Adam Locke
3d36df5cbd
[DOCS] Move common scripting use cases up a level (#73445) 2021-05-27 07:38:55 -04:00
James Rodewig
4386008ae2
[DOCS] Add xrefs to script APIs (#72954) 2021-05-12 08:30:49 -04:00
James Rodewig
0edb8f4708
[DOCS] Document missing script APIs (#72175)
Documents the following APIs:

* [Delete stored script][0]
* [Get stored script][1]
* [Get script contexts][2]
* [Get script languages][3]

[0]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json
[1]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json
[2]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/get_script_context.json
[3]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/get_script_languages.json
2021-05-04 11:03:30 -04:00
Adam Locke
44a19732ab
[DOCS] Add field extraction use cases to scripting docs (#71596)
* [DOCS] Add field extraction use cases to scripting docs

* Adding file

* Remove extra space

* Add dissect pattern to split and retrieve data

* Fix list spacing

* Incorporating review feedback
2021-05-03 16:24:28 -04:00
James Rodewig
53fb357da5 [DOCS] Clarify <script-id> parameter def 2021-04-23 15:05:35 -04:00
James Rodewig
93784444f7 [DOCS] Fix created stored script API request paths 2021-04-23 11:38:06 -04:00
James Rodewig
6dbad503d9 [DOCS] Correct source param data type 2021-04-19 10:42:22 -04:00
James Rodewig
f9c5f55c4b
[DOCS] Document create stored script API (#71493) 2021-04-19 09:19:12 -04:00
Adam Locke
14aba7bcff
[DOCS] Expand examples for runtime fields in a search query (#71237)
* Add warning admonition for removing runtime fields.

* Add cross-link to runtime fields.

* Expanding examples for runtime fields in a search request.

* Clarifying language and simplifying response tests.
2021-04-02 15:00:54 -04:00
James Rodewig
693807a6d3
[DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
Adam Locke
aba4422606
[DOCS] Focus scripting docs on Painless (#69748)
* Initial changes for scripting.

* Shorten script examples.

* Expanding types docs.

* Updating types.

* Fixing broken cross-link.

* Fixing map error.

* Incorporating review feedback.

* Fixing broken table.

* Adding more info about reference types.

* Fixing broken path.

* Adding more info an examples for def type.

* Adding more info on operators.

* Incorporating review feedback.

* Adding notconsole for example.

* Removing comments in example.

* More review feedback.

* Editorial changes.

* Incorporating more reviewer feedback.

* Rewrites based on review feedback.

* Adding new sections for storing scripts and shortening scripts.

* Adding redirect for stored scripts.

* Adding DELETE for stored script plus link.

* Adding section for updating docs with scripts.

* Incorporating final feedback from reviews.

* Tightening up a few areas.

* Minor change around other languages.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-03-18 15:58:33 -04:00
James Rodewig
c3f40a856e
[DOCS] Fix ingest script compilation rate and cache size (#61468) 2020-08-24 10:26:38 -04:00
James Rodewig
a94e5cb7c4
[DOCS] Replace Wikipedia links with attribute (#61171) 2020-08-17 09:44:24 -04:00
James Rodewig
6b9b8c5e31
[DOCS] Move script and stored fields content to search fields page (#60826)
Changes:

* Moves `Retrieve selected fields` to its own page and adds a title abbreviation.
* Adds existing script and stored fields content to `Retrieve selected fields`
* Adds a xref for `Retrieve selected fields` to `Search your data`
* Adds related redirects and updates existing xrefs
2020-08-06 12:45:03 -04:00
debadair
518457a394
[DOCS] Mention that inline scripts need to be enabled for Kibana (#60633) 2020-08-05 15:56:24 -07:00
James Rodewig
56c778235c
[DOCS] Fix metadata field refs (#60764) 2020-08-05 13:21:00 -04:00
James Rodewig
a4dc336c16
[DOCS] Replace twitter dataset in search/agg docs (#60667) 2020-08-04 13:31:52 -04:00
James Rodewig
ae01606785
[DOCS] Replace twitter dataset in docs (#60604) 2020-08-03 12:49:56 -04:00
Alexander Reelsen
c7ac9e7073
[DOCS] http -> https, remove outdated plugin docs (#60380)
Plugin discovery documentation contained information about installing
Elasticsearch 2.0 and installing an oracle JDK, both of which is no
longer valid.

While noticing that the instructions used cleartext HTTP to install
packages, this commit replaces HTTPs links instead of HTTP where possible.

In addition a few community links have been removed, as they do not seem
to exist anymore.
2020-07-31 15:58:38 -04:00
James Rodewig
441c3a21b1
[DOCS] Update my-index examples (#60132)
Changes the following example index names to `my-index-000001` for consistency:

* `my-index`
* `my_index`
* `myindex`
2020-07-27 14:46:39 -04:00
James Rodewig
d5b03f668b
[DOCS] Move search sort docs to separate page (#60123)
Moves the search sort docs from the deprecated 'Request Body Search'
page to a new subpage of 'Run a search'.

No substantive changes were made to the content.
2020-07-23 12:58:57 -04:00
James Rodewig
2774cd6938
[DOCS] Swap [float] for [discrete] (#60124)
Changes instances of `[float]` in our docs for `[discrete]`.

Asciidoctor prefers the `[discrete]` tag for floating headings:
https://asciidoctor.org/docs/asciidoc-asciidoctor-diffs/#blocks
2020-07-23 11:48:22 -04:00
James Rodewig
8a57800f1b
[DOCS] Add performance warning for scripts (#59890) 2020-07-20 14:04:35 -04:00
debadair
99c75f1e6c
[DOCS] Fixes problematic terminology (#58178)
* [DOCS] Fixes problematic terminology.

* Update docs/reference/snapshot-restore/register-repository.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2020-06-16 09:23:11 -07:00
István Zoltán Szabó
89c44e1695
[DOCS] Adds security privileges to _scripts endpoint docs. (#57795) 2020-06-08 14:33:21 +02:00
Julie Tibshirani
f46b04956b
Avoid unnecessary use of stored_fields in our docs. (#57488)
Generally we don't advocate for using `stored_fields`, and we're interested in
eventually removing the need for this parameter. So it's best to avoid using
stored fields in our docs examples when it's not actually necessary.

Individual changes:
* Avoid using 'stored_fields' in our docs.
* When defining script fields in top-hits, de-emphasize stored fields.
2020-06-01 17:29:48 -07:00
Stuart Tettemer
bd64da0960
Scripting: Deprecate general cache settings (#55038)
* Scripting: Deprecate general cache settings

* Add script.disable_max_compilations_rate setting

* Move construction to ScriptCache

* Use ScriptService to do updates of CacheHolder

* Remove fallbacks

* Add SCRIPT_DISABLE_MAX_COMPILATIONS_RATE_SETTING to ClusterSettings

* Node scope

* Use back compat

* 8.0 for bwc

* script.max_compilations_rate=2048/1m -> script.disable_max_compilations_rate=true in docker compose

* do not guard in esnode

* Doc update

* isSnapshotBuild() -> systemProperty 'es.script.disable_max_compilations_rate', 'true'

* Do not use snapshot in gradle to set max_compilations_rate

* Expose cacheHolder as package private

* monospace 75/5m in cbreaker docs, single space in using

* More detail in general compilation rate error

* Test: don't modify defaultConfig on upgrade
2020-04-22 12:33:33 -06:00