[Data views] Add composite runtime field docs with screenshots (#141013)

* add composite screenshots and docs

* add composite screenshots and docs

* add screenshots

* cleanup

* Update docs/management/manage-data-views.asciidoc

Co-authored-by: Anton Dosov <dosantappdev@gmail.com>

* Update docs/management/manage-data-views.asciidoc

Co-authored-by: Anton Dosov <dosantappdev@gmail.com>

Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
This commit is contained in:
Matthew Kime 2022-09-22 22:49:50 -05:00 committed by GitHub
parent 3ef304fd53
commit 004cb0e0dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

View file

@ -77,9 +77,11 @@ Return `Hello World!`:
emit("Hello World!");
----
image:management/images/runtime_field.png[Runtime field with keyword type]
[float]
[[perform-a-calculation-on-a-single-field]]
===== Perform a calculation on a single field
==== Perform a calculation on a single field
Calculate kilobytes from bytes:
@ -90,7 +92,7 @@ emit(doc['bytes'].value / 1024)
[float]
[[return-substring]]
===== Return a substring
==== Return a substring
Return the string that appears after the last slash in the URL:
@ -108,9 +110,24 @@ emit("");
----
[float]
[[replace-nulls-with-blanks]]
===== Replace nulls with blanks
[[composite-runtime-field]]
==== Return multiple fields with a composite runtime field
A single runtime field can also produce multiple subfields when the type `Composite` is selected. The script editor provides default types that can be customized for each subfields.
Return `keyword` and `double` type subfields. Note that the first argument for `emit` is the name of the subfield.
[source,text]
----
emit('subfield_a', 'Hello');
emit('subfield_b', 42);
----
image:management/images/runtime_field_composite.png[Runtime field with composite type]
[float]
[[replace-nulls-with-blanks]]
==== Replace nulls with blanks
Replace `null` values with `None`:
[source,text]