Skip to content

Commit

Permalink
Merge branch 'master' into drilldowns
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Mar 11, 2020
2 parents 12b8a3f + 3871798 commit 27b1854
Show file tree
Hide file tree
Showing 29 changed files with 1,907 additions and 905 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ const ELASTIC_LICENSE_HEADER = `
*/
`;

const allMochaRules = {};
const allMochaRulesOff = {};
Object.keys(require('eslint-plugin-mocha').rules).forEach(k => {
allMochaRules['mocha/' + k] = 'off';
allMochaRulesOff['mocha/' + k] = 'off';
});

module.exports = {
Expand Down Expand Up @@ -524,7 +524,7 @@ module.exports = {
*/
{
files: ['test/harden/*.js'],
rules: allMochaRules,
rules: allMochaRulesOff,
},

/**
Expand Down
16 changes: 7 additions & 9 deletions docs/getting-started/tutorial-discovering.asciidoc
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
[[tutorial-discovering]]
=== Discover your data

Using *Discover*, you can enter
Using *Discover*, enter
an {ref}/query-dsl-query-string-query.html#query-string-syntax[Elasticsearch
query] to search your data and filter the results.

. Open *Discover*.
+
The current index pattern appears below the filter bar, in this case `shakes*`.
You might need to click *New* in the menu bar to refresh the data.
The `shakes*` index pattern appears.

. Click the caret to the right of the current index pattern, and select `ba*`.
. To make `ba*` the current index, click the index pattern dropdown, then select `ba*`.
+
By default, all fields are shown for each matching document.

. In the search field, enter the following string:
. In the search field, enter:
+
[source,text]
account_number<100 AND balance>47500
Expand All @@ -25,11 +24,10 @@ excess of 47,500. Results appear for account numbers 8, 32, 78, 85, and 97.
[role="screenshot"]
image::images/tutorial-discover-2.png[]
+
. To choose which
fields to display, hover the pointer over the list of *Available fields*
and then click *add* next to each field you want include as a column in the table.
. Hover over the list of *Available fields*, then
click *add* next to each field you want include as a column in the table.
+
For example, if you add the `account_number` field, the display changes to a list of five
For example, when you add the `account_number` field, the display changes to a list of five
account numbers.
+
[role="screenshot"]
Expand Down
75 changes: 34 additions & 41 deletions docs/management/managing-fields.asciidoc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[[managing-fields]]
== Index Patterns and Fields
== Index patterns and fields

The *Index patterns* UI helps you create and manage
the index patterns that retrieve your data from Elasticsearch.
the index patterns that retrieve your data from {es}.

[role="screenshot"]
image::images/management-index-patterns.png[]

[float]
=== Create an index pattern

An index pattern is the glue that connects Kibana to your Elasticsearch data. Create an
index pattern whenever you load your own data into Kibana. To get started,
An index pattern is the glue that connects {kib} to your {es} data. Create an
index pattern whenever you load your own data into {kib}. To get started,
click *Create index pattern*, and then follow the guided steps. Refer to
<<index-patterns, Creating an index pattern>> for the types of index patterns
that you can create.
Expand All @@ -33,7 +33,7 @@ you create is automatically designated as the default pattern. The default
index pattern is loaded when you open *Discover*.

* *Refresh the index fields list.* You can refresh the index fields list to
pick up any newly-added fields. Doing so also resets Kibana’s popularity counters
pick up any newly-added fields. Doing so also resets the {kib} popularity counters
for the fields. The popularity counters are used in *Discover* to sort fields in lists.

* [[delete-pattern]]*Delete the index pattern.* This action removes the pattern from the list of
Expand All @@ -60,7 +60,7 @@ Kibana has field formatters for the following field types:
* <<field-formatters-numeric, Numbers>>

[[field-formatters-string]]
=== String Field Formatters
=== String field formatters

String fields support the `String` and `Url` formatters.

Expand All @@ -69,7 +69,7 @@ include::field-formatters/string-formatter.asciidoc[]
include::field-formatters/url-formatter.asciidoc[]

[[field-formatters-date]]
=== Date Field Formatters
=== Date field formatters

Date fields support the `Date`, `Url`, and `String` formatters.

Expand All @@ -81,19 +81,19 @@ include::field-formatters/string-formatter.asciidoc[]
include::field-formatters/url-formatter.asciidoc[]

[[field-formatters-geopoint]]
=== Geographic Point Field Formatters
=== Geographic point field formatters

Geographic point fields support the `String` formatter.

include::field-formatters/string-formatter.asciidoc[]

[[field-formatters-numeric]]
=== Numeric Field Formatters
=== Numeric field formatters

Numeric fields support the `Url`, `Bytes`, `Duration`, `Number`, `Percentage`, `String`, and `Color` formatters.

The `Bytes`, `Number`, and `Percentage` formatters enable you to choose the display formats of numbers in this field using
the <<numeral, Elastic numeral pattern>> syntax that Kibana maintains.
the <<numeral, Elastic numeral pattern>> syntax that {kib} maintains.

include::field-formatters/url-formatter.asciidoc[]

Expand All @@ -104,70 +104,63 @@ include::field-formatters/duration-formatter.asciidoc[]
include::field-formatters/color-formatter.asciidoc[]

[[scripted-fields]]
=== Scripted Fields
=== Scripted fields

Scripted fields compute data on the fly from the data in your Elasticsearch indices. Scripted field data is shown on
the Discover tab as part of the document data, and you can use scripted fields in your visualizations.
Scripted field values are computed at query time so they aren't indexed and cannot be searched using Kibana's default
query language. However they can be queried using Kibana's new <<kuery-query, experimental query language>>. Scripted
fields are also supported in the filter bar.
Scripted fields compute data on the fly from the data in your {es} indices. The data is shown on
the Discover tab as part of the document data, and you can use scripted fields in your visualizations. You query scripted fields with the <<kuery-query, {kib} query language>>, and can filter them using the filter bar. The scripted field values are computed at query time, so they aren't indexed and cannot be searched using the {kib} default
query language.

WARNING: Computing data on the fly with scripted fields can be very resource intensive and can have a direct impact on
Kibana's performance. Keep in mind that there's no built-in validation of a scripted field. If your scripts are
{kib} performance. Keep in mind that there's no built-in validation of a scripted field. If your scripts are
buggy, you'll get exceptions whenever you try to view the dynamically generated data.

When you define a scripted field in Kibana, you have a choice of scripting languages. Starting with 5.0, the default
When you define a scripted field in {kib}, you have a choice of scripting languages. In 5.0 and later, the default
options are {ref}/modules-scripting-expression.html[Lucene expressions] and {ref}/modules-scripting-painless.html[Painless].
While you can use other scripting languages if you enable dynamic scripting for them in Elasticsearch, this is not recommended
While you can use other scripting languages if you enable dynamic scripting for them in {es}, this is not recommended
because they cannot be sufficiently {ref}/modules-scripting-security.html[sandboxed].

WARNING: Use of Groovy, JavaScript, and Python scripting is deprecated starting in Elasticsearch 5.0, and support for those
scripting languages will be removed in the future.
WARNING: In 5.0 and later, Groovy, JavaScript, and Python scripting are deprecated and unsupported.

You can reference any single value numeric field in your expressions, for example:

----
doc['field_name'].value
----

For more background on scripted fields and additional examples, refer to this blog:
https://www.elastic.co/blog/using-painless-kibana-scripted-fields[Using Painless in Kibana scripted fields]
For more information on scripted fields and additional examples, refer to
https://www.elastic.co/blog/using-painless-kibana-scripted-fields[Using Painless in {kib} scripted fields]

[float]
[[create-scripted-field]]
=== Creating a Scripted Field
To create a scripted field:
=== Create a scripted field

. Go to *Management > Kibana > Index Patterns*
. Go to *Management > {kib} > Index Patterns*
. Select the index pattern you want to add a scripted field to.
. Go to the pattern's *Scripted fields* tab.
. Click *Add scripted field*.
. Go to the *Scripted fields* tab for the index pattern, then click *Add scripted field*.
. Enter a name for the scripted field.
. Enter the expression that you want to use to compute a value on the fly from your index data.
. Click *Create field*.

For more information about scripted fields in Elasticsearch, see
For more information about scripted fields in {es}, see
{ref}/modules-scripting.html[Scripting].

[float]
[[update-scripted-field]]
=== Updating a Scripted Field
To modify a scripted field:
=== Update a scripted field

. Go to *Management > Kibana > Index Patterns*
. Click the index pattern's *Scripted fields* tab.
. Go to *Management > {kib} > Index Patterns*
. Click the *Scripted fields* tab for the index pattern.
. Click the *Edit* button for the scripted field you want to change.
. Make your changes and then click *Save field* to update the field.
. Make your changes, then click *Save field*.

WARNING: Keep in mind that there's no built-in validation of a scripted field. If your scripts are buggy, you'll get
WARNING: Built-in validation is unsupported for scripted fields. If your scripts are buggy, you'll get
exceptions whenever you try to view the dynamically generated data.

[float]
[[delete-scripted-field]]
=== Deleting a Scripted Field
To delete a scripted field:
=== Delete a scripted field

. Go to *Management > Kibana > Index Patterns*
. Click the index pattern's *Scripted fields* tab.
. Click the *Delete* button for the scripted field you want to remove.
. Click *Delete* in the confirmation window.
. Go to *Management > {kib} > Index Patterns*
. Click the *Scripted fields* tab for the index pattern.
. Click *Delete* for the scripted field you want to remove.
. Click *Delete* on the confirmation window.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ function prepSetParams(key: PersistedStateKey, value: any, path: PersistedStateP
// key must be the value, set the entire state using it
if (value === undefined && (isPlainObject(key) || path.length > 0)) {
// setting entire tree, swap the key and value to write to the state
return {
value: key,
key: undefined,
};
value = key;
key = undefined;
}

// ensure the value being passed in is never mutated
Expand Down
Loading

0 comments on commit 27b1854

Please sign in to comment.