Commit graph

13 commits

Author SHA1 Message Date
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
Stuart Tettemer
4a8e5ada23
Scripting: Add char position of script errors (#51069)
Add the character position of a scripting error to error responses.

The contents of the `position` field are experimental and subject to
change.  Currently, `offset` refers to the character location where the
error was encountered, `start` and `end` define a range of characters
that contain the error.

eg.
```
{
  "error": {
    "root_cause": [
      {
        "type": "script_exception",
        "reason": "runtime error",
        "script_stack": [
          "y = x;",
          "     ^---- HERE"
        ],
        "script": "def x = new ArrayList(); Map y = x;",
        "lang": "painless",
        "position": {
          "offset": 33,
          "start": 29,
          "end": 35
        }
      }
```

Refs: #50993

* Check position only for 7.7+

* 7.7 && decrement before assign

* Use correct experimental tag, update doc test responses, off by one yaml

* Do not duplicate error.caused_by in replacement

* Add position under causedby
2020-01-21 10:57:09 -07:00
Jack Conradson
75a5a0bbb9
Document use of context in put stored script (#50446)
This documents how to test compile a stored script against a specific 
context when using PUT/POST.
2019-12-20 10:52:44 -08:00
Ryan Ernst
4de0d77777
Switch stored script example to script_score query (#47691)
The example use of a scoring script was incorrectly using a filter
script query, which has no scoring, and thus no _score variable
avialable. This commit converts the example doc to using the newer
script_score query.
2019-10-07 17:08:37 -07:00
James Rodewig
5c78f606c2
[DOCS] Change // CONSOLE comments to [source,console] (#46440) 2019-09-09 10:45:37 -04:00
James Rodewig
26323f0db3
[DOCS] Add template docs to scripts. Reorder template examples. (#45817)
* [DOCS] Add template docs to scripts. Reorder template examples.

* Adds a 'Search template' section to the 'How to use scripts' chapter.
  This links to the 'Search template' chapter for detailed info and
  examples.

* Reorders and retitles several examples in the 'Search template'
  chapter. This is primarily to make examples for storing, deleting, and
  using search templates more prominent.

* Change <templatename> to <templateid>
2019-08-22 08:40:09 -04:00
Ryan Ernst
18c537652f
Fix old name of script context in docs (#45410)
The docs contain an example how to limit the scripting contexts allowed,
but the example used an outdated name for the scoring context.

closes #44232
2019-08-12 09:28:44 -07:00
James Rodewig
ea1adb61c2
[DOCS] Update anchors and links for Elasticsearch API relocation (#44500) 2019-07-19 09:16:35 -04:00
Tal Levy
5e285f25d1
update docs referencing allowed script types (#44143)
- javadoc fix referencing incorrect number of script types
- explicitely mention ability to specify stored script type
  in the allowed_types setting
2019-07-12 08:09:11 -07:00
James Rodewig
fb079e527c
[DOCS] Move 'Scripting' section to top-level navigation. (#42939) 2019-06-06 10:45:04 -04:00