OpenSearch/docs/painless
Stuart Tettemer 500205e8c5
Add painless method getByPath, get value from nested collections with dotted path (#43170) (#43606)
Given a nested structure composed of Lists and Maps, getByPath will return the value
keyed by path.  getByPath is a method on Lists and Maps.

The path is string Map keys and integer List indices separated by dot. An optional third
argument returns a default value if the path lookup fails due to a missing value.

Eg.
['key0': ['a', 'b'], 'key1': ['c', 'd']].getByPath('key1') = ['c', 'd']
['key0': ['a', 'b'], 'key1': ['c', 'd']].getByPath('key1.0') = 'c'
['key0': ['a', 'b'], 'key1': ['c', 'd']].getByPath('key2', 'x') = 'x'
[['key0': 'value0'], ['key1': 'value1']].getByPath('1.key1') = 'value1'

Throws IllegalArgumentException if an item cannot be found and a default is not given.
Throws NumberFormatException if a path element operating on a List is not an integer.

Fixes #42769
2019-06-26 09:06:34 -06:00
..
painless-api-reference Add painless method getByPath, get value from nested collections with dotted path (#43170) (#43606) 2019-06-26 09:06:34 -06:00
painless-contexts Reorganize Painless doc structure (#42303) 2019-05-21 10:50:21 -07:00
painless-guide [DOCS] Add redirect for painless examples anchor 2019-06-25 12:34:18 -04:00
painless-lang-spec Reorganize Painless doc structure (#42303) 2019-05-21 10:50:21 -07:00
index.asciidoc Reorganize Painless doc structure (#42303) 2019-05-21 10:50:21 -07:00
painless-api-reference.asciidoc Task to generate Painless API's per context (#41233) 2019-04-23 11:28:27 -07:00
painless-contexts.asciidoc Reorganize Painless doc structure (#42303) 2019-05-21 10:50:21 -07:00
painless-guide.asciidoc Reorganize Painless doc structure (#42303) 2019-05-21 10:50:21 -07:00
painless-lang-spec.asciidoc Reorganize Painless doc structure (#42303) 2019-05-21 10:50:21 -07:00
redirects.asciidoc [DOCS] Add redirect for painless examples anchor 2019-06-25 12:34:18 -04:00