Commit Graph

37 Commits

Author SHA1 Message Date
Stef Nestor 828a36de75
Add frequently shared Painless field catch script (#75758)
Support frequently shares https://gist.github.com/jclosure/8e103dee2f7e9491845a2c0bb64c6b7a#gistcomment-3780127, adds into docs
2021-07-30 08:20:26 -04:00
Dan Hermann 01beb3f5d2
[DOCS] Expose community ID processor in Painless (#74306) 2021-06-21 14:21:51 -05:00
Dan Hermann 4e164c77ea
[DOCS] Expose URI parts processor in Painless (#73896) 2021-06-17 07:29:58 -05:00
James Rodewig 05256faa9a
[DOCS] Add missing anchor for script contexts (#73056) 2021-05-13 11:39:19 -04:00
Jack Conradson 5c6dae6125
[DOCS] Add runtime fields contexts to Painless execute API docs (#72131)
* add runtime fields contexts to execute docs

* Changes for formatting throughout

* Add missing context and context_setup

* Updating runtime field context

* Moving parameters and adopting a more standard API layout

* Update several examples

* Update more examples for runtime context

* Fix links

* Add boolean_field example and remove extraneous headings

* Add example for date_time context

* Remove extra space in TEST

* Updating date_time example

* Incorporating review feedback

* Adding cross links

* Tweaking some language based on feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Adam Locke <adam.locke@elastic.co>
2021-05-13 10:49:29 -04:00
Dan Hermann 3a9223d321
[DOCS] Ingest methods for Painless (#72722) 2021-05-06 14:17:32 -05: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
Adam Locke 1ee4c50217
[DOCS] Remove beta admonition for runtime fields. (#69550)
* [DOCS] Remove beta admonition for runtime fields.

* Remove other beta admonition from Painless guide.
2021-02-24 11:35:11 -05:00
James Rodewig a85f9cade8
[DOCS] Use consistent @timestamp field name (#69435) (#69448)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: Koji Kawamura <ijokarumawak@users.noreply.github.com>
2021-02-23 10:20:17 -05:00
Adam Locke 1fb257545f
[DOCS] Add runtime fields to Painless Guide (#67781)
* Adding runtime fields page for Painless context.

* Adds beta admonition to runtime fields and Painless docs.

* Fixing test errors and improving content sections.

* Adding refresh to fix test cases.

* Simplifying the ingest request to include refresh.

* Removing beta (will add in another PR) and updating examples.
2021-01-21 15:52:01 -05:00
Adam Locke 744f7c67c8
[DOCS] Updates to the runtime fields docs for 7.11+ (#67484)
* Moving examples to the page for retrieving runtime fields.

* Adding runtime_mappings to request body of search API.

* Updating runtime_mappings properties and adding runtime fields to search your data.

* Updating examples and hopefully fixing build failure.

* Fixing snippet formatting that was causing test failure.

* Adding page in Painless guide for runtime fields.

* Fixing typo.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-01-19 10:31:17 -05:00
Bhavya Gupta ae69472c78 Updated painless-walkthrough documentation (#65530)
Update documentation about regex note.
2020-12-02 09:28:42 -08:00
mushao999 08dc3d90f5
[DOCS] Fix plainess-datetime example script error (#62811) 2020-09-29 13:06:54 -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
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 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 a390e6d7be
[DOCS] Reformat Painless snippets to use two-space indents (#59776) 2020-07-17 11:03:19 -04:00
debadair 9dce026e06
[DOCS] Fixes terminology in the Painless docs (#58179) 2020-06-16 10:44:30 -07: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 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
James Rodewig f1bced7f7b
[DOCS] Correct typos in Painless datetime docs (#50563)
Fixes several typos and grammar errors raised by @glenacota in #47512.

Co-authored-by: Guido Lena Cota <guido.lenacota@gmail.com>
2020-01-02 13:13:00 -05:00
James Rodewig 529d3d5a91
[DOCS] Fix search request body link (#50498) 2019-12-26 12:32:27 -05:00
Xiang Dai 432bd0e92c Fix docs typos (#50365)
Fixes a few typos in the docs.

Signed-off-by: Xiang Dai 764524258@qq.com
2019-12-23 10:35:14 -05:00
Guido Lena Cota 1d24800482 [DOCS] Fix typos in Painless execute API docs(#47518) 2019-10-18 10:30:34 -04:00
James Rodewig 5772c1c7dd
[DOCS] [2 of 5] Change // CONSOLE comments to [source,console] (#46353) 2019-09-09 13:13:41 -04:00
James Rodewig e43be90e6c
[DOCS] [5 of 5] Change // TESTRESPONSE comments to [source,console-results] (#46449) 2019-09-06 14:05:36 -04:00
Nik Everett 948cdab15a
Build: Enable testing without magic comments (#46180)
Previously we only turned on tests if we saw either `// CONSOLE` or
`// TEST`. These magic comments are difficult for the docs build to deal
with so it has moved away from using them where possible. We should
catch up. This adds another trigger to enable testing: marking a snippet
with the `console` language. It looks like this:

```
[source,console]
----
GET /
----
```

This saves a line which is nice, I guess. But it is more important to me
that this is consistent with the way the docs build works now.

Similarly this enables response testing when you mark a snippet with the
language `console-result`. That looks like:
```
[source,console-result]
----
{
  "result": "0.1"
}
----
```

`// TESTRESPONSE` is still available for situations like `// TEST`: when
the response isn't *in* the console-result language (like `_cat`) or
when you want to perform substitutions on the generated test.

Should unblock #46159.
2019-09-04 11:23:29 -04:00
Jack Conradson 796dec34c8
Add several context examples for Painless date documentation (#44985) 2019-07-31 08:21:46 -07:00
Jack Conradson 7527157a51
Add Datetime Now to Painless Documentation (#43852)
This change explains why Painless doesn't natively support datetime now, and 
gives examples of how to create a version of now through user-defined 
parameters.
2019-07-02 15:38:16 -07:00
Jack Conradson c1acc6931d
Add timezone documentation for Painless datetimes (#43768) 2019-07-01 21:29:01 -07:00
James Rodewig e63e755744 [DOCS] Add redirect for painless examples anchor 2019-06-25 12:37:21 -04:00
Jack Conradson e9e232a244
Add Painless Docs for Datetime Inputs (#43128)
This changes add documentation for accessing datetimes in Painless scripts 
from the three most common inputs of params, _source, and doc.
2019-06-17 10:58:53 -07:00
Jack Conradson d06ceae5b6
Clean Up Painless Datetime Docs (#42869)
This change abstracts the specific types away from the different 
representations of datetime as a datetime representation in code can be all 
kinds of different things. This defines the three most common types of 
datetimes as numeric, string, and complex while outlining the type most 
typically used for these as long, String, and ZonedDateTime, respectively. 
Documentation uses the definitions while examples use the types. This makes 
the documentation easier to consume especially for people from a non-Java 
background.
2019-06-05 10:20:46 -07:00
Jack Conradson 7284de4106
Add Basic Date Docs to Painless (#42544) 2019-06-03 13:22:45 -07:00
Jack Conradson c59fbb3358
Reorganize Painless doc structure (#42303) 2019-05-21 13:47:47 -04:00