Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Adds a section on runtime fields to the Discover intro #99143

Merged
merged 5 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/discover/images/add-field-to-pattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/discover/images/hello-field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 36 additions & 2 deletions docs/user/discover.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
**_Gain insight to your data._**

*Discover* enables you to quickly search and filter your data, get information
about structure of the fields, and visualize your data with *Lens* and *Maps*.
about the structure of the fields, and visualize your data with *Lens* and *Maps*.
You can customize and save your searches and place them on a dashboard.

++++
Expand Down Expand Up @@ -110,6 +110,39 @@ image:images/document-table.png[Document table with fields for manufacturer, geo
. To rearrange the table columns, hover the mouse over a
column header, and then use the move and sort controls.

[float]
[[add-field-in-discover]]
=== Add a field

What happens if you forgot to define an important value as a separate field? Or, what if you
want to combine two fields and treat them as one?
You can add a field to your index pattern from inside of **Discover**,
and then use that field for analysis and visualizations,
the same way you do with other fields.

. Click the ellipsis icon (...), and then click *Add field to index pattern*.
+
[role="screenshot"]
image:images/add-field-to-pattern.png[Dropdown menu located next to index pattern field with item for adding a field to an index pattern, width=50%]

. In the *Create field* form, enter `hello` for the name.

. Turn on *Set value*.

. Use the Painless scripting language to define the field:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it would be good to add a link to the Painless docs here:
https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-painless.html

+
```ts
emit("Hello World!");
```

. Click *Save*.

. In the fields list, search for the *hello* field, and then click it.
+
[role="screenshot"]
image:images/hello-field.png[Top values for the hello field, width=50%]

For more information on adding fields and Painless scripting language examples, refer to <<runtime-fields, Explore your data with runtime fields>>.

[float]
[[search-in-discover]]
Expand Down Expand Up @@ -186,7 +219,8 @@ You can bookmark this document and share the link.
=== Save your search for later use

Save your search so you can repeat it later, generate a CSV report, or use it in visualizations, dashboards, and Canvas workpads.
Saving a search saves the query and the filters.
Saving a search saves the query text, filters,
and current view of *Discover*&mdash;the columns selected in the document table, the sort order, and the index pattern.

. In the toolbar, click **Save**.

Expand Down