Commit Graph

6751 Commits

Author SHA1 Message Date
Lisa Cawley ab139244d7
[DOCS] Fixes, sorts ML tagged regions (#52283) 2020-02-12 13:43:21 -08:00
Marios Trivyzas b847742b23
SQL: [Docs] Fix typo
Add missing closing "`".

Follows: 78a1185549
2020-02-12 21:48:36 +01:00
Marios Trivyzas a8b39ed842
Add a cluster setting to disallow expensive queries (#51385)
Add a new cluster setting `search.allow_expensive_queries` which by
default is `true`. If set to `false`, certain queries that have 
usually slow performance cannot be executed and an error message
is returned.

- Queries that need to do linear scans to identify matches:
  - Script queries
- Queries that have a high up-front cost:
  - Fuzzy queries
  - Regexp queries
  - Prefix queries (without index_prefixes enabled
  - Wildcard queries
  - Range queries on text and keyword fields
- Joining queries
  - HasParent queries
  - HasChild queries
  - ParentId queries
  - Nested queries
- Queries on deprecated 6.x geo shapes (using PrefixTree implementation)
- Queries that may have a high per-document cost:
  - Script score queries
  - Percolate queries

Closes: #29050
2020-02-12 18:06:04 +01:00
James Rodewig 6b62ec53db
[DOCS] Add EQL limitations page (#52001)
Documents limitations for EQL in Elasticsearch.
2020-02-12 08:45:15 -05:00
James Rodewig be8ae972bc
[DOCS] Add basic EQL search tutorial docs (#51574)
I plan to add additional sections to this page with future PRs:

* Specify timestamp and event type fields
* Specify a join key field
* Filter using query DSL
* Paginate a large response

See #51057.
2020-02-12 08:40:10 -05:00
Marios Trivyzas 78a1185549
SQL: [Docs] Add limitation for sorting on aggs (#52210)
Add a section to point out that when ordering by an aggregate
only plain aggregate functions are allowed, no scalars/operators
can be used on top of them.

Fixes: #52204
2020-02-12 12:54:42 +01:00
James Rodewig c82a050eef [DOCS] Include docs on permanently unreleased branches only (#51743)
Adds the ability to display docs on permanently unreleased branches,
such as `master` and `7.x`.

Also updates how the autoscaling and EQL docs are included.
Currently, these feature-flag docs would display on any unreleased
branches that contain the changes, such as 7.7.
2020-02-11 11:22:49 -05:00
David Turner a304d9a656
Ignore timeouts with single-node discovery (#52159)
Today we use `cluster.join.timeout` to prevent nodes from waiting indefinitely
if joining a faulty master that is too slow to respond, and
`cluster.publish.timeout` to allow a faulty master to detect that it is unable
to publish its cluster state updates in a timely fashion. If these timeouts
occur then the node restarts the discovery process in an attempt to find a
healthier master.

In the special case of `discovery.type: single-node` there is no point in
looking for another healthier master since the single node in the cluster is
all we've got. This commit suppresses these timeouts and instead lets the node
wait for joins and publications to succeed no matter how long this might take.
2020-02-11 14:00:06 +00:00
David Roberts 1a099fa075
[DOCS] Correct important note for xpack.transform.enabled (#52194)
Because transforms get assigned to an arbitrary data node it
is important that the transforms plugin is enabled on every
data node.
2020-02-11 12:54:09 +00:00
Yang Wang 5c9f79534f
Expose more authentication info to ingest pipeline (#51305)
The changes add more granularity for identiying the data ingestion user.
The ingest pipeline can now be configure to record authentication realm and
type. It can also record API key name and ID when one is in use. 
This improves traceability when data are being ingested from multiple agents
and will become more relevant with the incoming support of required
pipelines (#46847)

Resolves: #49106
2020-02-10 13:56:07 +11:00
Jason Tedor 749b623de0
Introduce jvm.options.d for customizing JVM options (#51882)
This commit introduces the ability to override JVM options by adding
custom JVM options files to a jvm.options.d directory. This simplifies
administration of Elasticsearch by not requiring administrators to keep
the root jvm.options file in sync with changes that we make to the root
jvm.options file. Instead, they are not expected to modify this file but
instead supply their own in jvm.options.d. In Docker installations, this
means they can bind mount this directory in. In future versions of
Elasticsearch, we can consider removing the root jvm.options file
(instead, providing all options there as system JVM options).
2020-02-08 16:54:26 -05:00
Igor Motov c50cfa0668
Add Boxplot Aggregation (#51948)
Adds a `boxplot` aggregation that calculates min, max, medium and the first
and the third quartiles of the given data set.

Closes #33112
2020-02-07 18:01:20 -05:00
Lee Hinman e95cc14d13
Allow forcemerge in the hot phase for ILM policies (#52073)
* Allow forcemerge in the hot phase for ILM policies

This commit changes the `forcemerge` action to also be allowed in the `hot` phase for policies. The
forcemerge will occur after a rollover, and allows users to take advantage of higher disk speeds for
performing the force merge (on a separate node type, for example).

On caveat with this is that a `forcemerge` in the `hot` phase *MUST* be accompanied by a `rollover`
action. ILM validates policies to ensure this is the case.

Resolves #43165

* Use anyMatch instead of findAny in validation

* Make randomTimeseriesLifecyclePolicy single-pass
2020-02-07 15:26:00 -07:00
Andrei Stefan f1d1cceaca
Telemetry data initial implementation (#51715) 2020-02-07 23:00:26 +02:00
debadair c93b8b91c3
[DOCS] Fixed typo. (#52071) 2020-02-07 11:03:56 -08:00
James Rodewig d01f5fcc4a
Revert "[DOCS] Include docs on permanently unreleased branches only (#51743)" (#52066)
This reverts commit f21b6411a1.
2020-02-07 12:12:29 -05:00
David Kyle f64c6359ed
[ML] Make Ensemble feature names optional (#51996)
The featureNames field is requisite in individual models but is not required by the Ensemble.
2020-02-07 10:07:18 +00:00
Jason Tedor 5a12e5856a
Add autoscaling API skelton (#51564)
The main purpose of this commit is to add a single autoscaling REST
endpoint skeleton, for the purpose of starting to build out the build
and testing infrastructure that will surround it. For example, rather
than commiting a fully-functioning autoscaling API, we introduce here
the skeleton so that we can start wiring up the build and testing
infrastructure, establish security roles/permissions, an so on. This
way, in a forthcoming PR that introduces actual functionality, that PR
will be smaller and have less distractions around that sort of
infrastructure.
2020-02-06 19:15:17 -05:00
James Rodewig f21b6411a1
[DOCS] Include docs on permanently unreleased branches only (#51743)
Adds the ability to display docs on permanently unreleased branches,
such as `master` and `7.x`.

Also updates how the autoscaling and EQL docs are included.
Currently, these feature-flag docs would display on any unreleased
branches that contain the changes, such as 7.7.
2020-02-06 14:44:20 -05:00
Armin Braun 26b9cf787d
Add Trace Logging of REST Requests (#51684)
Being able to trace log all REST requests to a node would make debugging
a number of issues a lot easier.
2020-02-06 20:05:03 +01:00
David Roberts 72346b91f9
[ML] Add new categorization stats to model_size_stats (#51879)
This change adds support for the following new model_size_stats
fields:

- categorized_doc_count
- total_category_count
- frequent_category_count
- rare_category_count
- dead_category_count
- categorization_status

Relates #50749
2020-02-06 17:08:43 +00:00
Rory Hunter 87ee44d8bc
Clarify use of ES_JAVA_OPTS and Docker (#51867)
Closes #51626. Tweak the documentation around configuring the heap size
when using Docker, to state that:

- using `ES_JAVA_OPTS` is the preferred method
- Any `ES_JAVA_OPTS` overrides the defaults in `jvm.options`
- It's possible to bind-mount a custom `jvm.options`
2020-02-06 09:34:53 +00:00
Lisa Cawley 62b5b95151
[DOCS] Adds curl explanation to getting started content (#51963) 2020-02-05 19:00:28 -08:00
Przemko Robakowski 5560135542
Add empty_value parameter to CSV processor (#51567)
* Add empty_value parameter to CSV processor

This change adds `empty_value` parameter to the CSV processor.
This value is used to fill empty fields. Fields will be skipped
if this parameter is ommited. This behavior is the same for both
quoted and unquoted fields.

* docs updated

* Fix compilation problem

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-05 22:36:00 +01:00
Lisa Cawley 14900c23fd
[DOCS] Defines data frame transform stats API objects (#44197) 2020-02-05 12:23:30 -08:00
Lisa Cawley 84dbadb20b
[DOCS] Augments update license API (#51903) 2020-02-05 11:07:02 -08:00
Edu González de la Herrán f03b6ff789
added note for allocation during hot phase (#51149)
ILM takes care of allocation during warm and cold phases, but it doesn't take care of it for new indices (hot phase). We should add a note mentioning that fact, as if the user wants a hot / warm architecture they should ensure new indices are allocated by default on hot nodes, or they might end up on warm/cold nodes.
2020-02-05 18:06:51 +01:00
Lee Hinman b475b2872b
Add documentation about ILM forcemerge with best_compression (#51893)
This adds the option to the parameter list and a warning about the index being unavailable during
the close and open operations.

Relates to #49974
2020-02-05 09:37:12 -07:00
James Rodewig 99c1ee88e8
[DOCS] Add EQL syntax page (#51821)
Adds documentation for basic EQL syntax.

Joins, sequences, and other syntax to be added as its supported
in future development.

Co-Authored-By: Ross Wolf <31489089+rw-access@users.noreply.github.com>
2020-02-05 08:12:09 -05:00
David Kyle 34743bcd6f
[ML] Remove stray field from inference docs (#51870)
model_info_field is not a valid option
2020-02-05 10:49:36 +00:00
debadair 8c5cdfff07
[DOCS] Edit ILM GS tutorial (#51513)
* [DOCS] Edit ILM GS tutorial

* [DOCS] Incorporated review feedback from @andreidan.

* [DOCS] Removed test link & fixed anchor & title.

* Update docs/reference/ilm/getting-started-ilm.asciidoc

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>
2020-02-04 15:37:45 -08:00
Adrien Grand d5bc6d6de0
Move analysis/mappings stats to cluster-stats. (#51260)
Closes #51138
2020-02-04 16:56:49 +01:00
Florian Kelbert bd52041f92
[DOCS] Remove unneeded comma from CSV processor example (#51859) 2020-02-04 09:23:43 -05:00
baifan cdd858ab95
[DOCS] Fix `disk.used_percent` typo in `_cat/nodes` docs (#51854)
Corrects an example for the `disk.used_percent` parameter in `_cat/nodes` API.
2020-02-04 09:15:06 -05:00
Grzegorz Banasiak c21837fe3c
[DOCS] Fix index_prefixes link in 'faster prefix queries' docs (#51833)
Fixes a link in 'faster prefix queries' which incorrectly redirects to index_phrases mapping parameter description instead of index_prefixes.
2020-02-04 08:36:16 -05:00
William Brafford 9e4d397e98
Use standard format for reload settings API (#51560)
* Use standard format for reload settings API

The reload-secure-settings API page was not reorganized for the standard
API format, so this commit is reorganizing the page and adding some
links to the page in related documentation.

* Fix broken links

* Reorder examples to correctly check API response

* Note that only certain settings are reloadable

* [DOCS] Edits layout

* [DOCS] Removes unnecessary callouts

Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2020-02-03 12:19:10 -05:00
James Rodewig b9fafc7dc6
[DOCS] Document node stats response meta (#51263)
Documents several metadata-related parameters returned by the
`GET _nodes/stats` API.
2020-02-03 08:33:02 -05:00
Darren LaCasse ea67e24b7b
[DOCS] Remove extra word (#51757) 2020-01-31 10:27:37 -08:00
Mark Tozzi 928c663ce0
Fix dangling 'either' in weighted average docs (#51748) 2020-01-31 12:45:46 -05:00
James Rodewig 445655f1dd
[DOCS] Add redirects, update JSON spec to fix docs build (#51747)
Docs build [#11556][0] broke due to several outdated or incorrect links
in the JSON REST spec.

This fixes those links where possible and adds redirects.

[0]: https://elasticsearch-ci.elastic.co/job/elastic+docs+master+build/11556/
2020-01-31 10:35:04 -05:00
Mayya Sharipova 620996287a
Remove docs related to index time boosting (#51704)
As there is no really index time boosting,
as boost is only applied during query time,
this removes mentions of index time boosting.
2020-01-31 09:01:52 -05:00
Nhat Nguyen 6e0fbbd4db
Remove translog retention settings (#51697)
The translog retention settings index.translog.retention.size and 
index.translog.retention.age were effectively ignored in 7.4, 
deprecated in 7.7, and now removed in 8.0 in favor of soft-deletes.

Closes #50775
2020-01-31 08:18:07 -05:00
Christoph Büscher 7cec5f93be
Make `date_range` query rounding consistent with `date` (#50237)
Currently the rounding used in range queries can behave differently for `date`
and `date_range` as explained in #50009. The behaviour on `date` fields is 
the one we document in https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html#range-query-date-math-rounding. 
This change adapts the rounding behaviour for RangeType.DATE so it uses the
same logic as the `date` for the `date_range` type.

Closes #50009
2020-01-31 14:15:13 +01:00
István Zoltán Szabó 67f14c3978
[DOCS] Adds PUT inference API docs (#51231)
Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2020-01-31 13:12:24 +01:00
István Zoltán Szabó 850278c69a
[DOCS] Adds recommendation on dedicated master-eligible nodes (#51674)
Co-Authored-By: James Rodewig <james.rodewig@elastic.co>
2020-01-31 12:51:46 +01:00
Sven Schliesing c61888fadf [Docs] Fix typo in node-tool.asciidoc (#51667) 2020-01-31 10:38:27 +01:00
Lisa Cawley 32adcd2c9d
[DOCS] Adds missing testenv attribute (#51719) 2020-01-30 16:13:26 -08:00
Lee Hinman b03647e593
Add xpack/basic scope to SLM documentation (#51711)
This adds the required

```
[role="xpack"]
[testenv="basic"]
```

To the top of the SLM documentation

Relates to #51678
2020-01-30 16:17:50 -07:00
Lee Hinman 226fc4038b
Rename ILM history index enablement setting (#51698)
* Rename ILM history index enablement setting

The previous setting was `index.lifecycle.history_index_enabled`, this commit changes it to
`indices.lifecycle.history_index_enabled` to indicate this is not an index-level setting (it's node
level).
2020-01-30 14:34:03 -07:00
Dan Hermann dd8add6215
Secure password for monitoring HTTP exporter (#50919)
Adds a secure and reloadable SECURE_AUTH_PASSWORD setting to allow keystore entries in the form "xpack.monitoring.exporters.*.auth.secure_password" to securely supply passwords for monitoring HTTP exporters. Also deprecates the insecure `AUTH_PASSWORD` setting.
2020-01-30 15:01:14 -06:00
James Rodewig a7ebddd2f2
[DOCS] Add attribute for Lucene analysis links (#51687)
Adds a `lucene-analysis-docs` attribute for the Lucene `/analysis/`
javadocs directory. This should prevent typos and keep the docs DRY.
2020-01-30 11:22:30 -05:00
Alex Perrin b9d36fdb5e
Update getting-started-slm.asciidoc
Changed the example schedule from 1:30 to 2:30 as the default of slm.retention_schedule to delete snapshot is 1:30 as well.
If a customer just copy/paste the snippet it can end up with no snapshot being deleted.
2020-01-30 15:39:59 +01:00
James Rodewig 3c28a10b85
[DOCS] Rewrite analysis intro (#51184)
* [DOCS] Rewrite analysis intro. Move index/search analysis content.

* Rewrites 'Text analysis' page intro as high-level definition.
  Adds guidance on when users should configure text analysis
* Rewrites and splits index/search analysis content:
  * Conceptual content -> 'Index and search analysis' under 'Concepts'
  * Task-based content -> 'Specify an analyzer' under 'Configure...'
* Adds detailed examples for when to use the same index/search analyzer
  and when not.
* Adds new example snippets for specifying search analyzers

* clarifications

* Add toc. Decrement headings.

* Reword 'When to configure' section

* Remove sentence from tip
2020-01-30 09:19:53 -05:00
Marios Trivyzas f41efd6753
SQL: Fix ORDER BY YEAR() function (#51562)
Previously, if YEAR() was used as and ORDER BY argument without being
wrapped with another scalar (e.g. YEAR(birth_date) + 10), no script
ordering was used but instead the underlying field (e.g. birth_date)
was used instead as a performance optimisation. This works correctly if
YEAR() is the only ORDER BY arg but if further args are used as tie
breakers for the ordering wrong results are produced. This is because
2 rows with the different birth_date but on the same year are not tied
as the underlying ordering is on birth_date and not on the
YEAR(birth_date), and the following ORDER BY args are ignored.

Remove this optimisation for YEAR() to avoid incorrect results in
such cases.

As a consequence another bug is revealed: scalar functions on top
of nested fields produce scripted sorting/filtering which is not yet
supported. In such cases no error was thrown but instead all values for
such nested fields were null and were passed to the script implementing
the sorting/filtering, producing incorrect results.

Detect such cases and throw a validation exception.

Fixes: #51224
2020-01-30 14:48:34 +01:00
Henning Andersen ccc323f524
[DOCS] Task management API experimental status issue (#51634)
Add issue reference to documentation.

Relates #51628
2020-01-30 14:15:05 +01:00
Lisa Cawley 0e38bd8294
[DOCS] Minor fixes in transform documentation (#51633) 2020-01-29 16:52:40 -08:00
Lisa Cawley f9ba80a7c5
[DOCS] Removes beta qualifiers from transform documentation (#51553) 2020-01-29 08:40:38 -08:00
Nhat Nguyen 2aa650c75e
Deprecate translog retention settings (#51588)
This change deprecates the translog retention settings as they are 
effectively ignored since 7.4.

Relates #50775
Relates #45473
2020-01-29 10:19:22 -05:00
Yannick Welsch a57a9a31c3 Stricter checks of setup and teardown in docs tests (#51430)
Made checks stricter after backporting PR.
2020-01-28 17:53:57 +01:00
Albert Zaharovits f016b17ac1
Deprecate timeout.tcp_read AD/LDAP realm setting (#47305)
* Done

* Update docs/reference/settings/security-settings.asciidoc

Co-Authored-By: Ioannis Kakavas <ikakavas@protonmail.com>

* Update docs/reference/settings/security-settings.asciidoc

Co-Authored-By: Ioannis Kakavas <ikakavas@protonmail.com>

* refactored ldap_search explanation

* Tim's review!

* [ML] Use CSV ingest processor in find_file_structure ingest pipeline (#51492)

Changes the find_file_structure response to include a CSV
ingest processor in the ingest pipeline it suggests.

Previously the Kibana file upload functionality parsed CSV
in the browser, but by parsing CSV in the ingest pipeline
it makes the Kibana file upload functionality more easily
interchangable with Filebeat such that the configurations
it creates can more easily be used to import data with the
same structure repeatedly in production.

* Add test verify replica allocator with sync_id (#51512)

We no longer issue new sync_ids in 8.0, but we still need to make sure 
that the replica allocator prefers copies with matching sync_id. This
commit adds tests for that.

Relates #50776

* Formatting: keep simple if / else on the same line (#51526)

Previous the formatter was breaking simple if/else statements (i.e.
without braces) onto separate lines, which could be fragile because the
formatter cannot also introduce braces. Instead, keep such expressions
on the same line.

* Nits

Co-authored-by: Ioannis Kakavas <ikakavas@protonmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: David Roberts <dave.roberts@elastic.co>
Co-authored-by: Nhat Nguyen <nhat.nguyen@elastic.co>
Co-authored-by: Rory Hunter <pugnascotia@users.noreply.github.com>
2020-01-28 18:43:29 +02:00
James Rodewig a687b1f180
[DOCS] Document `indices` cluster stats (#50527)
Documents the header and `indices` response parameters returned by the
`_cluster/stats` API.

Co-Authored-By: David Turner <david.turner@elastic.co>
2020-01-28 10:57:45 -05:00
James Rodewig c99a0e9a5e
[DOCS] Reformat unique token filter docs (#50748)
* Updates the description
* Adds analyze, custom analyzer, and custom filter snippets
* Adds parameter documentation
2020-01-28 10:33:45 -05:00
David Roberts a5a2e4eaee
[ML] Use CSV ingest processor in find_file_structure ingest pipeline (#51492)
Changes the find_file_structure response to include a CSV
ingest processor in the ingest pipeline it suggests.

Previously the Kibana file upload functionality parsed CSV
in the browser, but by parsing CSV in the ingest pipeline
it makes the Kibana file upload functionality more easily
interchangable with Filebeat such that the configurations
it creates can more easily be used to import data with the
same structure repeatedly in production.
2020-01-28 12:46:00 +00:00
Yannick Welsch e5dd459745
Avoid unnecessary setup and teardown in docs tests (#51430)
The docs tests have recently been running much slower than before (see #49753).

The gist here is that with ILM/SLM we do a lot of unnecessary setup / teardown work on each
test. Compounded with the slightly slower cluster state storage mechanism, this causes the
tests to run much slower.

In particular, on RAMDisk, docs:check is taking

ES 7.4: 6:55 minutes
ES master: 16:09 minutes
ES with this commit: 6:52 minutes

on SSD, docs:check is taking

ES 7.4: ??? minutes
ES master: 32:20 minutes
ES with this commit: 11:21 minutes
2020-01-28 09:52:24 +01:00
Yang Wang 83a819ab63
Make order setting required for Realm config (#51195)
The order config must be explicitly specified for each realm.
It must also be unique for each realm. 
This is a breaking change and will begin to take effect in 8.0

Resolves: #37614
2020-01-28 17:59:54 +11:00
debadair d5cacd8676
[DOCS] Split off ILM overview to a separate topic. (#51287)
* [DOCS} Split off overview to a separate topic.

* [DOCS] Incorporated feedback from @jrodewig.
2020-01-27 19:39:24 -08:00
William Brafford c117c0cf0a
Password-protected Keystore Feature Branch PR (#51123)
* Reload secure settings with password (#43197)

If a password is not set, we assume an empty string to be
compatible with previous behavior.
Only allow the reload to be broadcast to other nodes if TLS is
enabled for the transport layer.

* Add passphrase support to elasticsearch-keystore (#38498)

This change adds support for keystore passphrases to all subcommands
of the elasticsearch-keystore cli tool and adds a subcommand for
changing the passphrase of an existing keystore.
The work to read the passphrase in Elasticsearch when
loading, which will be addressed in a different PR.

Subcommands of elasticsearch-keystore can handle (open and create)
passphrase protected keystores

When reading a keystore, a user is only prompted for a passphrase
only if the keystore is passphrase protected.

When creating a keystore, a user is allowed (default behavior) to create one with an
empty passphrase

Passphrase can be set to be empty when changing/setting it for an
existing keystore

Relates to: #32691
Supersedes: #37472

* Restore behavior for force parameter (#44847)

Turns out that the behavior of `-f` for the add and add-file sub
commands where it would also forcibly create the keystore if it
didn't exist, was by design - although undocumented.
This change restores that behavior auto-creating a keystore that
is not password protected if the force flag is used. The force
OptionSpec is moved to the BaseKeyStoreCommand as we will presumably
want to maintain the same behavior in any other command that takes
a force option.

*  Handle pwd protected keystores in all CLI tools  (#45289)

This change ensures that `elasticsearch-setup-passwords` and
`elasticsearch-saml-metadata` can handle a password protected
elasticsearch.keystore.
For setup passwords the user would be prompted to add the
elasticsearch keystore password upon running the tool. There is no
option to pass the password as a parameter as we assume the user is
present in order to enter the desired passwords for the built-in
users.
For saml-metadata, we prompt for the keystore password at all times
even though we'd only need to read something from the keystore when
there is a signing or encryption configuration.

* Modify docs for setup passwords and saml metadata cli (#45797)

Adds a sentence in the documentation of `elasticsearch-setup-passwords`
and `elasticsearch-saml-metadata` to describe that users would be
prompted for the keystore's password when running these CLI tools,
when the keystore is password protected.

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Elasticsearch keystore passphrase for startup scripts (#44775)

This commit allows a user to provide a keystore password on Elasticsearch
startup, but only prompts when the keystore exists and is encrypted.

The entrypoint in Java code is standard input. When the Bootstrap class is
checking for secure keystore settings, it checks whether or not the keystore
is encrypted. If so, we read one line from standard input and use this as the
password. For simplicity's sake, we allow a maximum passphrase length of 128
characters. (This is an arbitrary limit and could be increased or eliminated.
It is also enforced in the keystore tools, so that a user can't create a
password that's too long to enter at startup.)

In order to provide a password on standard input, we have to account for four
different ways of starting Elasticsearch: the bash startup script, the Windows
batch startup script, systemd startup, and docker startup. We use wrapper
scripts to reduce systemd and docker to the bash case: in both cases, a
wrapper script can read a passphrase from the filesystem and pass it to the
bash script.

In order to simplify testing the need for a passphrase, I have added a
has-passwd command to the keystore tool. This command can run silently, and
exit with status 0 when the keystore has a password. It exits with status 1 if
the keystore doesn't exist or exists and is unencrypted.

A good deal of the code-change in this commit has to do with refactoring
packaging tests to cleanly use the same tests for both the "archive" and the
"package" cases. This required not only moving tests around, but also adding
some convenience methods for an abstraction layer over distribution-specific
commands.

* Adjust docs for password protected keystore (#45054)

This commit adds relevant parts in the elasticsearch-keystore
sub-commands reference docs and in the reload secure settings API
doc.

* Fix failing Keystore Passphrase test for feature branch (#50154)

One problem with the passphrase-from-file tests, as written, is that
they would leave a SystemD environment variable set when they failed,
and this setting would cause elasticsearch startup to fail for other
tests as well. By using a try-finally, I hope that these tests will fail
more gracefully.

It appears that our Fedora and Ubuntu environments may be configured to
store journald information under /var rather than under /run, so that it
will persist between boots. Our destructive tests that read from the
journal need to account for this in order to avoid trying to limit the
output we check in tests.

* Run keystore management tests on docker distros (#50610)

* Add Docker handling to PackagingTestCase

Keystore tests need to be able to run in the Docker case. We can do this
by using a DockerShell instead of a plain Shell when Docker is running.

* Improve ES startup check for docker

Previously we were checking truncated output for the packaged JDK as
an indication that Elasticsearch had started. With new preliminary
password checks, we might get a false positive from ES keystore
commands, so we have to check specifically that the Elasticsearch
class from the Bootstrap package is what's running.

* Test password-protected keystore with Docker (#50803)

This commit adds two tests for the case where we mount a
password-protected keystore into a Docker container and provide a
password via a Docker environment variable.

We also fix a logging bug where we were logging the identifier for an
array of strings rather than the contents of that array.

* Add documentation for keystore startup prompting (#50821)

When a keystore is password-protected, Elasticsearch will prompt at
startup. This commit adds documentation for this prompt for the archive,
systemd, and Docker cases.

Co-authored-by: Lisa Cawley <lcawley@elastic.co>

* Warn when unable to upgrade keystore on debian (#51011)

For Red Hat RPM upgrades, we warn if we can't upgrade the keystore. This
commit brings the same logic to the code for Debian packages. See the
posttrans file for gets executed for RPMs.

* Restore handling of string input

Adds tests that were mistakenly removed. One of these tests proved
we were not handling the the stdin (-x) option correctly when no
input was added. This commit restores the original approach of
reading stdin one char at a time until there is no more (-1, \r, \n)
instead of using readline() that might return null

* Apply spotless reformatting

* Use '--since' flag to get recent journal messages

When we get Elasticsearch logs from journald, we want to fetch only log
messages from the last run. There are two reasons for this. First, if
there are many logs, we might get a string that's too large for our
utility methods. Second, when we're looking for a specific message or
error, we almost certainly want to look only at messages from the last
execution.

Previously, we've been trying to do this by clearing out the physical
files under the journald process. But there seems to be some contention
over these directories: if journald writes a log file in between when
our deletion command deletes the file and when it deletes the log
directory, the deletion will fail.

It seems to me that we might be able to use journald's "--since" flag to
retrieve only log messages from the last run, and that this might be
less likely to fail due to race conditions in file deletion.

Unfortunately, it looks as if the "--since" flag has a granularity of
one-second. I've added a two-second sleep to make sure that there's a
sufficient gap between the test that will read from journald and the
test before it.

* Use new journald wrapper pattern

* Update version added in secure settings request

Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Ioannis Kakavas <ikakavas@protonmail.com>
2020-01-27 19:51:39 -05:00
Gordon Brown 44f5ed6fd9
Deprecate creation of dot-prefixed index names except for hidden and system indices (#49959)
This commit deprecates the creation of dot-prefixed index names (e.g.
.watches) unless they are either 1) a hidden index, or 2) registered by
a plugin that extends SystemIndexPlugin. This is the first step
towards more thorough protections for system indices.

This commit also modifies several plugins which use dot-prefixed indices
to register indices they own as system indices, and adds a plugin to
register .tasks as a system index.
2020-01-27 17:18:26 -07:00
James Rodewig 0a31b67cc5
[DOCS] Add top-level EQL docs page. Adds EQL requirements page. (#51334)
* Creates a top-level page for EQL in the ES reference.
   This page contains a high-level introduction and will include a nav for other EQL docs pages as they're built.

* Creates a requirements page.
  This page outlines the fields needed to use EQL in ES.
2020-01-27 16:03:23 -05:00
James Rodewig 0189d29c53
[DOCS] Add response snippets to 'Testing analyzers' page (#51427)
Adds response snippets to the `POST _analyze` snippets in the 'Testing
analyzers' page.

Co-authored-by: Emmanuel DEMEY <demey.emmanuel@gmail.com>
2020-01-27 08:41:05 -05:00
Lisa Cawley b4ccd3e793
[DOCS] Adds http to elasticsearch-certutil command reference (#51188) 2020-01-24 09:56:51 -08:00
Elvis Saravia 520da54e63
update pipeline.asciidoc
typo
2020-01-24 14:03:01 +01:00
István Zoltán Szabó 85e581282d
[DOCS] Refines description. (#51400) 2020-01-24 13:31:44 +01:00
Benjamin Trent c9e285c1e6
[ML][Inference] add tags url param to GET (#51330)
Adds a new URL parameter, `tags` to the GET _ml/inference/<model_id> endpoint.

This parameter allows the list of models to be further reduced to those who contain all the provided tags.
2020-01-24 07:30:56 -05:00
David Turner 2cae185b26
Allow decimal max_task_wait_time in docs (#51352)
The regex for the response to `GET _cat/health?v` in `getting-started.asciidoc`
requires `max_task_wait_time` to match `(-|\\d+(micros|ms|s))`, which doesn't
match times such as `3.9ms` that contain a decimal point. This commit adjusts
the regex to match times formatted like this too.

Fixes #47537
2020-01-24 08:58:18 +00:00
Rory Hunter 8a6d68b173
Make the Docker build more re-usable in Cloud (#50277)
Closes #49926 and #46166. Rework the Docker image so that it comes with a tiny
init system, to ensure ML processes are correctly cleaned up, and to run ES
as a regular user instead of root.

Also:

   * Ensure no files in the image have the setuid/setgid flag
   * Also improve dependency tracking in the build
   * Remove TAKE_FILE_OWNERSHIP option and its documentation
2020-01-23 10:58:40 +00:00
debadair 0fed96eebc [DOCS] Align with ILM API docs (#48705)
* [DOCS] Reconciled with Snapshot/Restore reorg
2020-01-22 20:44:19 -08:00
Lisa Cawley 789aeaedab
[DOCS] Updates categorization examples with wizard screenshots (#51133) 2020-01-22 11:26:10 -08:00
Lisa Cawley 551a83a2ff
[DOCS] Clarify interval, frequency, and bucket span in ML APIs and example (#51280) 2020-01-22 08:08:31 -08:00
Igor Motov 23be11cf6c
Fix leftover mentions of method parameter in Percentile Aggs (#51272)
The method parameter is not used in the percentile aggs, instead
the method is determined by the presence of `hdr` or `tdigest`
objects.

Relates to #8324
2020-01-22 05:02:48 -10:00
David Kyle 7978f0b8ef
[ML] Calculate results and snapshot retention using latest bucket timestamps (#51061)
The retention period is calculated relative to the last bucket result or snapshot
time rather than wall clock
2020-01-22 10:08:41 +00:00
Russ Cam ff22445364 [Docs] Including leading slash in range query doc example URLs (#51277) 2020-01-22 09:38:52 +01:00
Deb Adair 6f3581173b Revert "[DOCS] Align with ILM API docs (#48705)"
This reverts commit ec9437832d.
2020-01-21 22:32:40 -08:00
debadair ec9437832d
[DOCS] Align with ILM API docs (#48705)
* [DOCS] Reconciled with Snapshot/Restore reorg
2020-01-21 19:58:17 -08: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
István Zoltán Szabó 4e0e6e83e0
[DOCS] Fixes indentation in inference processor code snippet (#51252) 2020-01-21 16:21:17 +01:00
Jason Tedor 2f048cd1e7
Exclude autoscaling docs from release docs (#51190)
Since autoscaling is currently only under development, this commit
causes the autoscaling docs to be excluded any time that release docs
are being built.
2020-01-20 10:52:19 -05:00
Andrei Stefan 45b8bf619a
SQL: add support for passing query parameters in REST API calls (#51029)
* REST PreparedStatement-like query parameters are now supported in the form of an array of non-object, non-array values where ES SQL parser will try to infer the data type of the value being passed as parameter.
2020-01-20 15:29:53 +02:00
István Zoltán Szabó 451eb1fa1f
[DOCS] Expands the documentation of Node Query Cache (#51105)
Co-authored-by: debadair <debadair@elastic.co>
2020-01-20 11:11:57 +01:00
Jess 97b12c11db [Docs] Small edits to Ranking Evaluation API docs (#51116)
Small updates to grammar, syntax, and unclear wordings.
2020-01-20 10:30:54 +01:00
István Zoltán Szabó fd97b772ad
[DOCS] Removes CCS limitation item from Transforms limitations. (#51151) 2020-01-20 09:42:04 +01:00
Nhat Nguyen c893a3e495
Make soft-deletes mandatory in 8.0 (#51122)
Creating indices with soft deletes disabled is no longer supported in 8.0.
2020-01-17 17:34:22 -05:00
Jason Tedor d96038eca8
Initial autoscaling commit (#51161)
This commit merely adds the skeleton for the autoscaling project, adding
the basics to include the autoscaling module in the default
distribution, opt-in to code formatting, and a placeholder for the docs.
2020-01-17 14:54:53 -05:00
István Zoltán Szabó 087a048ee6 [DOCS] Adds text about data types to the categorization docs (#51145) 2020-01-17 09:52:57 -08:00
cachedout 39b6d2570c [DOCS] Recommend Metricbeat for 7.x (#49758) 2020-01-17 09:44:16 -08:00
Lisa Cawley 98ec57aafe
[DOCS] Remove out-dated monitoring note (#51129) 2020-01-17 09:21:20 -08:00
Jay Modi 173c3bdac4
Introduce hidden indices (#50452)
This change introduces a new feature for indices so that they can be
hidden from wildcard expansion. The feature is referred to as hidden
indices. An index can be marked hidden through the use of an index
setting, `index.hidden`, at creation time. One primary use case for
this feature is to have a construct that fits indices that are created
by the stack that contain data used for display to the user and/or
intended for querying by the user. The desire to keep them hidden is
to avoid confusing users when searching all of the data they have
indexed and getting results returned from indices created by the
system.

Hidden indices have the following properties:
* API calls for all indices (empty indices array, _all, or *) will not
  return hidden indices by default.
* Wildcard expansion will not return hidden indices by default unless
  the wildcard pattern begins with a `.`. This behavior is similar to
  shell expansion of wildcards.
* REST API calls can enable the expansion of wildcards to hidden
  indices with the `expand_wildcards` parameter. To expand wildcards
  to hidden indices, use the value `hidden` in conjunction with `open`
  and/or `closed`.
* Creation of a hidden index will ignore global index templates. A
  global index template is one with a match-all pattern.
* Index templates can make an index hidden, with the exception of a
  global index template.
* Accessing a hidden index directly requires no additional parameters.

Relates #50251
2020-01-17 09:16:31 -07:00
Dimitris Athanasiou 24ce598239
[ML] DF Analytics _explain API should skip object fields (#51115)
Object fields cannot be used as features. At the moment _explain
API includes them and even worse it allows it does not error when
an object field is excluded. This creates the expectation to the
user that all children fields will also be excluded while it's not
the case.

This commit omits object fields from the _explain API and also
adds an error if an object field is included or excluded.
2020-01-17 12:24:17 +02:00
James Rodewig 380cc7c290
[DOCS] Collapse node stats response sections (#51063)
elastic/docs#1687 added support for the `[%collapsible]` Asciidoc
attribute, which creates collapsible sections in the HTML output.

This PR makes two related changes to the nodes stats API documentation:

* Makes the response parameter sections collapsible. This allows users
  to more easily navigate the page without long walls of text.

* Reorders the response parameter sections to match the default order
  returned by the API.

Relates to #47524.
2020-01-16 13:18:36 -05:00
James Rodewig 0fa6ac0fb9
[DOCS] Add tutorials section to analysis topic (#50809)
Adds a 'Configure text analysis' page to house tutorial content for the
analysis topic.

Also relocates the following pages as children as this new page:

* 'Test an analyzer'
* 'Configuring built-in analyzers'
* 'Create a custom analyzer'

I plan to add a tutorial for specifying index-time and search-time
analyzers to this section as part of a future PR.
2020-01-16 13:11:42 -05:00
James Rodewig 0605eb2078
[DOCS] Add concepts section to analysis topic (#50801)
This helps the topic better match the structure of
our machine learning docs, e.g.
https://www.elastic.co/guide/en/machine-learning/7.5/ml-concepts.html

This PR only includes the 'Anatomy of an analyzer' page as a 'Concepts'
child page, but I plan to add other concepts, such as 'Index time vs.
search time', with later PRs.
2020-01-16 13:00:04 -05:00
James Rodewig 8f06f94d9b
[DOCS] Retitle analysis reference pages (#51071)
* Changes titles to sentence case.

* Appends pages with 'reference' to differentiate their content from
  conceptual overviews.

* Moves the 'Normalizers' page to end of the Analysis topic pages.
2020-01-16 12:27:54 -05:00
James Rodewig aeec0593c2
[DOCS] Fix indent issue in similarity snippet (#51107)
Updates snippet to consistently use 2-space indentation. The snippet
previously used a mix of tab/5-space and 2-space indents.

Co-authored-by: Peter Johnson <wiz@wiz.co.nz>

Co-authored-by: Peter Johnson <peter@geocode.earth>
2020-01-16 10:59:18 -05:00
Nhat Nguyen 09b46c8646
Goodbye and thank you synced flush! (#50882)
Synced flush was a brilliant idea. It supports instant recoveries with a 
quite small implementation. However, with the presence of sequence
numbers and retention leases, it is no longer needed. This change
removes it from 8.0.

Relates #5077
2020-01-16 09:43:07 -05:00
James Rodewig ca1a32c28a
[DOCS] Use same index in Cluster Allocation Explain docs (#50936)
Updates several example snippets in the Cluster Allocation Explain API
docs to consistently use the `my_index` index.

Previously, the snippets switches from `my_index` to `idx`, which could
confuse users.

Co-authored-by: Emmanuel DEMEY <demey.emmanuel@gmail.com>

Co-authored-by: Emmanuel DEMEY <demey.emmanuel@gmail.com>
2020-01-16 09:13:31 -05:00
Ted Timmons a636fdabb7 [Docs] Fix short alias for 'unassigned.for' (#51059)
The short alias for `unassigned.for` is `uf`, not 'ua'.
2020-01-16 12:09:54 +01:00
PND e16d1e5725 [Docs] Fix example output of edge n-gram token filter. (#51085) 2020-01-16 11:34:23 +01:00
David Kyle 5ad1d0d2cc
Fix hardcoded version replacement in put-dfanalytics.asciidoc (#51056) 2020-01-16 10:06:45 +00:00
Lee Hinman da80e32663
Add blurb about ILM-injected unfollow action (#51009)
These injected actions are harmless and safe to ignore for non-CCR indices.

Resolves #50548
2020-01-15 09:46:34 -07:00
Robin Clarke 09c98cbd74 [Docs] Fix sub-heading in start-stop-ilm.asciidoc (#51045)
Removed superfluous `=`.
2020-01-15 16:18:44 +01:00
Martijn van Groningen 2b2935fd52
Add pipeline name to ingest metadata (#50467)
This commit adds the name of the current pipeline to ingest metadata.
This pipeline name is accessible under the following key: '_ingest.pipeline'.

Example usage in pipeline:
PUT /_ingest/pipeline/2
{
    "processors": [
        {
            "set": {
                "field": "pipeline_name",
                "value": "{{_ingest.pipeline}}"
            }
        }
    ]
}

Closes #42106
2020-01-15 16:17:05 +01:00
Przemysław Witek 999884d8fb
Add missing docs for new evaluation metrics (#50967) 2020-01-15 14:23:37 +01:00
István Zoltán Szabó 406810c172
[DOCS] Describes the relationship of the time-related settings in anomaly detection docs (#50959)
Co-Authored-By: David Roberts <dave.roberts@elastic.co>
2020-01-15 08:45:03 +01:00
James Rodewig ae2ec858a2
[DOCS] Document `breakers`, `script`, and `discovery` node stats (#50509)
Documents the `breakers`, `script`, and `discovery` parameters returned
by the `_nodes/stats` API.
2020-01-14 16:48:35 -05:00
lcawl 5eaa3a79b8 [DOCS] Fixes typo in keystore command 2020-01-14 11:56:08 -08:00
Yannick Welsch d94b81e8b0
Remove custom metadata tool (#50813)
Adds a command-line tool to remove broken custom metadata from the cluster state.

Relates to #48701
2020-01-14 18:33:53 +01:00
Tal Levy 6c86606d2a
Adds support for geo-bounds filtering in geogrid aggregations (#50002)
It is fairly common to filter the geo point candidates in
geohash_grid and geotile_grid aggregations according to some
viewable bounding box. This change introduces the option of
specifying this filter directly in the tiling aggregation.

This is even more relevant to `geo_shape` where the bounds will restrict
the shape to be within the bounds

this optional `bounds` parameter is parsed in an equivalent fashion to 
the bounds specified in the geo_bounding_box query.
2020-01-14 08:29:10 -08:00
Christoph Büscher 9a4357ae04
Deprecate and remove camel-case nGram and edgeNGram tokenizers (#50862)
We already deprecated and removed the camel-case versions of the nGram and edgeNGram 
filters a while ago and we should do the same with the nGram and edgeNGram tokenizers.
This PR deprecates the use of these names in favour of ngram and edge_ngram in 7
and disallows usage in new indices starting with 8.

Closes #50561
2020-01-14 17:18:47 +01:00
James Rodewig 9c192ca037
[DOCS] Use `s` parameter in cat API overview example (#50616)
Updates a snippet to use the `s` query string parameter rather than
piping the output to a separate `sort` command.

This ensures the snippet is tested and available in clients other than
curl (Kibana console, etc.).

Issue was originally raised by @hackaholic in #40926.
2020-01-14 08:21:32 -05:00
Dimitris Athanasiou 4d2be9bd32
[ML] Add num_top_feature_importance_values param to regression and classi… (#50914)
Adds a new parameter to regression and classification that enables computation
of importance for the top most important features. The computation of the importance
is based on SHAP (SHapley Additive exPlanations) method.
2020-01-14 15:01:47 +02:00
Larry Gregory fa4869a94b Deprecating kibana_user and kibana_dashboard_only_user roles (#46456)
This change adds a new `kibana_admin` role, and deprecates
the old `kibana_user` and`kibana_dashboard_only_user`roles.

The deprecation is implemented via a new reserved metadata
attribute, which can be consumed from the API and also triggers
deprecation logging when used (by a user authenticating to
Elasticsearch).

Some docs have been updated to avoid references to these
deprecated roles.

Co-authored-by: Tim Vernum <tim@adjective.org>
Co-authored-by: Larry Gregory <legrego@users.noreply.github.com>
2020-01-14 18:08:44 +11:00
Nhat Nguyen ac8f5cd542
Remove outdated requirement of CCR (#50859)
With retention leases, users do not need to set 
index.soft_deletes.retention.operations. This change removes it from the
requirements of CCR
2020-01-13 19:59:50 -05:00
Nhat Nguyen 08b8450b62 Deprecate synced flush (#50835)
A normal flush has the same effect as a synced flush on Elasticsearch
7.6 or later. It's deprecated in 7.6 and will be removed in 8.0.

Relates #50776
2020-01-13 19:54:23 -05:00
Peter Dyson f77ff8ba09 [DOCS] Array of index patterns is also valid source indices with transform (#50777) 2020-01-13 15:44:35 -08:00
Lisa Cawley f4ff5d866d
[DOCS] Adds elasticsearch-keystore command reference (#50872) 2020-01-13 13:02:06 -08:00
Lee Hinman f53c9680ed
Refresh cached phase policy definition if possible on new poli… (#50820)
* Refresh cached phase policy definition if possible on new policy

There are some cases when updating a policy does not change the
structure in a significant way. In these cases, we can reread the
policy definition for any indices using the updated policy.

This commit adds this refreshing to the `TransportPutLifecycleAction`
to allow this. It allows us to do things like change the configuration
values for a particular step, even when on that step (for example,
changing the rollover criteria while on the `check-rollover-ready` step).

There are more cases where the phase definition can be reread that just
the ones checked here (for example, removing an action that has already
been passed), and those will be added in subsequent work.

Relates to #48431
2020-01-13 13:44:56 -07:00
junmuz 06cec760da [DOCS] Correct typo in `ignore_malformed` mapping parm docs (#50780) 2020-01-13 09:49:10 -05:00
Yannick Welsch a0513217db
Move metadata storage to Lucene (#50907)
Today we split the on-disk cluster metadata across many files: one file for the metadata of each
index, plus one file for the global metadata and another for the manifest. Most metadata updates
only touch a few of these files, but some must write them all. If a node holds a large number of
indices then it's possible its disks are not fast enough to process a complete metadata update before timing out. In severe cases affecting master-eligible nodes this can prevent an election
from succeeding.

This commit uses Lucene as a metadata storage for the cluster state, and is a squashed version
of the following PRs that were targeting a feature branch:


* Introduce Lucene-based metadata persistence (#48733)

This commit introduces `LucenePersistedState` which master-eligible nodes
can use to persist the cluster metadata in a Lucene index rather than in
many separate files.

Relates #48701

* Remove per-index metadata without assigned shards (#49234)

Today on master-eligible nodes we maintain per-index metadata files for every
index. However, we also keep this metadata in the `LucenePersistedState`, and
only use the per-index metadata files for importing dangling indices. However
there is no point in importing a dangling index without any shard data, so we
do not need to maintain these extra files any more.

This commit removes per-index metadata files from nodes which do not hold any
shards of those indices.

Relates #48701

* Use Lucene exclusively for metadata storage (#50144)

This moves metadata persistence to Lucene for all node types. It also reenables BWC and adds
an interoperability layer for upgrades from prior versions.

This commit disables a number of tests related to dangling indices and command-line tools.
Those will be addressed in follow-ups.

Relates #48701

* Add command-line tool support for Lucene-based metadata storage (#50179)

Adds command-line tool support (unsafe-bootstrap, detach-cluster, repurpose, & shard
commands) for the Lucene-based metadata storage.

Relates #48701

* Use single directory for metadata (#50639)

Earlier PRs for #48701 introduced a separate directory for the cluster state. This is not needed
though, and introduces an additional unnecessary cognitive burden to the users.

Co-Authored-By: David Turner <david.turner@elastic.co>

* Add async dangling indices support (#50642)

Adds support for writing out dangling indices in an asynchronous way. Also provides an option to
avoid writing out dangling indices at all.

Relates #48701

* Fold node metadata into new node storage (#50741)

Moves node metadata to uses the new storage mechanism (see #48701) as the authoritative source.

* Write CS asynchronously on data-only nodes (#50782)

Writes cluster states out asynchronously on data-only nodes. The main reason for writing out
the cluster state at all is so that the data-only nodes can snap into a cluster, that they can do a
bit of bootstrap validation and so that the shard recovery tools work.
Cluster states that are written asynchronously have their voting configuration adapted to a non
existing configuration so that these nodes cannot mistakenly become master even if their node
role is changed back and forth.

Relates #48701

* Remove persistent cluster settings tool (#50694)

Adds the elasticsearch-node remove-settings tool to remove persistent settings from the on
disk cluster state in case where it contains incompatible settings that prevent the cluster from
forming.

Relates #48701

* Make cluster state writer resilient to disk issues (#50805)

Adds handling to make the cluster state writer resilient to disk issues. Relates to #48701

* Omit writing global metadata if no change (#50901)

Uses the same optimization for the new cluster state storage layer as the old one, writing global
metadata only when changed. Avoids writing out the global metadata if none of the persistent
fields changed. Speeds up server:integTest by ~10%.

Relates #48701

* DanglingIndicesIT should ensure node removed first (#50896)

These tests occasionally failed because the deletion was submitted before the
restarting node was removed from the cluster, causing the deletion not to be
fully acked. This commit fixes this by checking the restarting node has been
removed from the cluster.

Co-authored-by: David Turner <david.turner@elastic.co>
2020-01-13 14:10:02 +01:00
Tim Vernum 8727f2717e
Add max_resource_units to enterprise license (#50735)
The enterprise license type must has "max_resource_units" and may not
have "max_nodes".

This change adds support for this new field, validation that the field
is present if-and-only-if the license is enterprise and bumps the
license version number to reflect the new field.
2020-01-13 18:13:20 +11:00
James Rodewig 979bfa6691
[DOCS] Fix time_zone example in range query docs (#50830)
One of the example snippets in the range query docs was missing a
required 'T' in the `date` format. This adds the required 'T'.
2020-01-10 07:23:25 -06:00
Julie Tibshirani 54f5907067
Remove the 'template' field in index templates. (#49460)
The `template` field was deprecated in 6.0 in favor of `index_patterns`, and can
now be removed.

Relates to #21009.
2020-01-09 17:07:58 -08:00
debadair a3b851e9b9
[DOCS] Move snapshot-restore out of modules. (#49618)
* [DOCS] Move snapshot-restore docs out of modules.

* [DOCS] Incorporates comments from @jrodewig.

* [DOCS] Fix snippet tests
2020-01-09 16:12:02 -08:00
Matt Braymer-Hayes 5d289e32d9 Fix typo in refresh API docs (#50759) 2020-01-09 13:35:05 -06:00
Lisa Cawley 9ade684150
[DOCS] Update license expiry links (#50812) 2020-01-09 11:26:34 -08:00
Lisa Cawley 979a28d2b5
[DOCS] Clarify detector_index property in ML APIs (#50723) 2020-01-09 08:12:53 -08:00
István Zoltán Szabó b3457154a3
[DOCS] Fine-tunes data frame analytics API docs formatting. (#50799) 2020-01-09 16:21:01 +01:00
Benjamin Trent 207525bb70
[Transform] fail to start/put on missing pipeline (#50701)
If a pipeline referenced by a transform does not exist, we should not allow the transform to be created. 

We do allow the pipeline existence check to be skipped with defer_validations, but if the pipeline still does not exist on `_start`, the pipeline will fail to start.

relates:  #50135
2020-01-09 09:31:44 -05:00
István Zoltán Szabó b683f96e23
[DOCS] Moves analysis resources to PUT DFA API docs (#50704)
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2020-01-09 13:57:11 +01:00
István Zoltán Szabó 659b4ceb97
[DOCS] Improves find_file_structure documentation (#50743)
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2020-01-09 11:19:19 +01:00
István Zoltán Szabó bc21500201
[DOCS] Forms role and privilege requirements as bulleted lists in DFA API docs (#50732)
Co-Authored-By: Lisa Cawley <lcawley@elastic.co>
2020-01-09 10:44:07 +01:00
István Zoltán Szabó 2f55c3566f
[DOCS] Clarifies model_size_stats.total_xxx_field_count objects and removes notes in GET job stats API docs. (#50728) 2020-01-09 09:43:55 +01:00
István Zoltán Szabó d5fcb73b1f
[DOCS] Improves description for forecast_stats (#50729)
Co-Authored-By: Lisa Cawley <lcawley@elastic.co>
2020-01-09 09:31:30 +01:00
Przemko Robakowski 060100d732
ILM action to wait for SLM policy execution (#50454)
This change add new ILM action to wait for SLM policy execution to ensure that index has snapshot before deletion.

Closes #45067
2020-01-09 07:37:05 +01:00
James Rodewig 14185fbf79 [DOCS] Add section ID to analysis overview page 2020-01-08 14:43:05 -06:00
James Rodewig 495ce1add0
[DOCS] Add overview page to analysis topic (#50515)
Adds a 'text analysis overview' page to the analysis topic docs.

The goals of this page are:

* Concisely summarize the analysis process while avoiding in-depth concepts, tutorials, or API examples
* Explain why analysis is important, largely through highlighting problems with full-text searches missing analysis
* Highlight how analysis can be used to improve search results
2020-01-08 12:53:08 -06:00
István Zoltán Szabó 81a99410e1
[DOCS] Adds DFA resources as deleted page to redirects. (#50756) 2020-01-08 18:53:57 +01:00
James Rodewig 3631f93d45
[DOCS] Add default index-time analyzer example (#50501)
The Analysis docs mention including a default analyzer in the index settings. However, no example snippet is included.

This adds an example snippet that users can easily copy and adjust.
2020-01-08 11:06:54 -06:00
blueSky1825821 3cc663364a [Docs] Update similarity.asciidoc (#50719)
DFRSimilarity -> DFR similarity
2020-01-08 17:49:24 +01:00
James Rodewig d3cd4fbd62 [DOCS] Fix typo in mapping date format docs 2020-01-08 07:55:21 -06:00
Christoph Büscher 84af7c4844
Remove _reload_search_analyzer experimental status (#50696)
Removing the experimental status in the docs and the rest specs.
2020-01-08 10:34:41 +01:00
Evgenia Badyanova bb736f7ecd
[DOCS] Update reference documentation that mentions CMS (#50542)
Relates to https://github.com/elastic/elasticsearch/issues/46973
2020-01-07 17:19:15 -05:00
Nik Everett 326d696d9a
Support offset in composite aggs (#50609)
Adds support for the `offset` parameter to the `date_histogram` source
of composite aggs. The `offset` parameter is supported by the normal
`date_histogram` aggregation and is useful for folks that need to
measure things from, say, 6am one day to 6am the next day.

This is implemented by creating a new `Rounding` that knows how to
handle offsets and delegates to other rounding implementations. That
implementation doesn't fully implement the `Rounding` contract, namely
`nextRoundingValue`. That method isn't used by composite aggs so I can't
be sure that any implementation that I add will be correct. I propose to
leave it throwing `UnsupportedOperationException` until I need it.

Closes #48757
2020-01-07 14:49:09 -05:00
James Rodewig e090b9bcad
[DOCS] Fuzzy wildcard not supported in `query_string` (#50466)
The `query_string` does not support mixing wildcards with fuzziness.
This adds a related warning to the `query_string` docs.
2020-01-07 12:53:47 -06:00
James Rodewig b0ffc60b80
[DOCS] Reformat reverse token filter docs (#50672)
* Updates the description and adds a Lucene link
* Adds analyze and custom analyzer snippets
2020-01-07 10:54:16 -06:00
James Rodewig 2bc37ea4e9
[DOCS] Reformat truncate token filter docs (#50687)
* Updates the description and adds a Lucene link
* Adds analyze, custom analyzer, and custom filter snippets
* Adds parameter documentation
2020-01-07 10:32:54 -06:00
arkel-s f20367e405 [DOCS] Add example format for `date_optional_time` (#50458)
Adds an example format for `date_optional_time` to the `format` mapping
parameter docs.

Closes #50457
2020-01-07 10:07:29 -06:00
James Rodewig a5b6242aa5
[DOCS] Update SQL REST API pages for new structure (#50690)
#43007 restructured the SQL REST API docs so they display across several pages.

This updates up a reference that assumes a single page in the "Paginating through a large response" section. It also reformats a tip for the Kibana console.

Closes #50688
2020-01-07 09:17:54 -06:00
James Rodewig 53b643404b
[DOCS] Remove unused docinfo.xml files (#50661)
This change is no-op.

The `index-docinfo.xml` and `index.x-docinfo.xml` were replaced by the
`index-extra-title-page.html` file in #50189.

Now that our documentation is built using direct HTML rather than
docbook, these XML files are no longer used.
2020-01-06 11:22:23 -06:00
James Rodewig 9a7ff38947
[DOCS] Remove unneeded redirects (#50510)
The docs/reference/redirects.asciidoc file stores a list of relocated or
deleted pages for the Elasticsearch Reference documentation.

This prunes several older redirects that are no longer needed.
2020-01-06 08:38:21 -06:00
David Turner 8c6f821c75
Remove the 'local' parameter of /_cat/nodes (#50594)
The cat nodes API performs a `ClusterStateAction` then a `NodesInfoAction`.
Today it accepts the `?local` parameter and passes this to the
`ClusterStateAction` but this parameter has no effect on the `NodesInfoAction`.
This is surprising, because `GET _cat/nodes?local` looks like it might be a
completely local call but in fact it still depends on every node in the
cluster.

This parameter was deprecated in 7.x in #50499 and this commit removes it.

Relates #50088
2020-01-06 14:12:51 +00:00
James Rodewig 7f35bcdfc9
[DOCS] Warn about using `geo_centroid` as sub-agg to `geohash_grid` (#50038)
If `geo_point fields` are multi-valued, using `geo_centroid` as a
sub-agg to `geohash_grid` could result in centroids outside of bucket
boundaries.

This adds a related warning to the geo_centroid agg docs.
2020-01-06 07:45:49 -06:00
Nhat Nguyen 0c0f45538c
Deprecate indices without soft-deletes (#50502)
Soft-deletes will be enabled for all indices in 8.0. Hence, we should 
deprecate new indices without soft-deletes in 7.x.
2020-01-05 18:30:17 -05:00
Lisa Cawley b13a755842
[DOCS] Adds missing timing_stats descriptions (#50574) 2020-01-03 09:07:08 -08:00
Orhan Toy 0db416921c [DOCS] Fix missing quote in script-score-query.asciidoc (#50590) 2020-01-03 16:15:18 +01:00
István Zoltán Szabó 675b98f90c
[DOCS] Fine-tunes training_percent definition. (#50601) 2020-01-03 14:49:43 +01:00
James Rodewig 90e139e252
[DOCS] Reformat uppercase token filter docs (#50555)
* Updates the description and adds a Lucene link
* Adds analyze and custom analyzer snippets
2020-01-03 08:34:11 -05:00
Dimitris Athanasiou af0ce426cc
[ML] Implement force deleting a data frame analytics job (#50553)
Adds a `force` parameter to the delete data frame analytics
request. When `force` is `true`, the action force-stops the
jobs and then proceeds to the deletion. This can be used in
order to delete a non-stopped job with a single request.

Closes #48124
2020-01-03 12:01:41 +02:00
Alan Woodward 32730cfdc5
Add fuzzy intervals source (#49762)
This intervals source will return terms that are similar to an input term, up to
an edit distance defined by fuzziness, similar to FuzzyQuery.

Closes #49595
2020-01-03 09:55:53 +00:00
István Zoltán Szabó fd50169c74
[DOCS] Specifies the possible data types of classification dependent_variable (#50582) 2020-01-03 10:41:38 +01:00
bellengao f0bfe78d58 Don't dump a stacktrace for invalid patterns when executing elasticsearch-croneval (#49744) 2020-01-02 16:10:21 -07:00
Lisa Cawley dd4ede5c56
[DOCS] Adds filter and calendar attributes (#50566) 2020-01-02 10:59:54 -08:00
Nik Everett a7cc0b0159
Docs: Refine note about `after_key` (#50475)
* Docs: Refine note about `after_key`

I was curious about composite aggregations, specifically I wanted to
know how to write a composite aggregation that had all of its buckets
filtered out so you *had* to use the `after_key`. Then I saw that we've
declared composite aggregations not to work with pipelines in #44180. So
I'm not sure you *can* do that any more. Which makes the note about
`after_key` inaccurate. This rejiggers that section of the docs a little
so it is more obvious that you send the `after_key` back to us. And so
it is more obvious that you should *only* use the `after_key` that we
give you rather than try to work it out for yourself.

* Apply suggestions from code review

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>

Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2020-01-02 10:02:55 -05:00
Oleg 1c2492136d Deprecate the 'local' parameter of /_cat/nodes (#50499)
The cat nodes API performs a `ClusterStateAction` then a `NodesInfoAction`.
Today it accepts the `?local` parameter and passes this to the
`ClusterStateAction` but this parameter has no effect on the `NodesInfoAction`.
This is surprising, because `GET _cat/nodes?local` looks like it might be a
completely local call but in fact it still depends on every node in the
cluster.

This commit deprecates the `?local` parameter on this API so that it can be
removed in 8.0.

Relates #50088
2020-01-02 14:22:40 +00:00
lcawl c7408a25f1 [DOCS] Minor fixes in ML APIs 2019-12-30 15:21:18 -08:00
Nhat Nguyen 9e46bbd306
Replace synced-flush with flush in rolling upgrade to 8.0 (#50524)
This change recommends using a regular flush instead of synced-flush in 
a rolling upgrade from 7.x to 8.0. We can perform noop recoveries with a
regular flush
2019-12-30 11:30:30 -05:00
James Rodewig 18ee52a5b2
[DOCS] Abbreviate token filter titles (#50511) 2019-12-27 11:00:51 -05:00
James Rodewig cfddddda0b
[DOCS] Fix search request body links (#50500)
PR #44238 changed several links related to the Elasticsearch search request body API. This updates several places still using outdated links or anchors.

This will ultimately let us remove some redirects related to those link changes.
2019-12-26 14:20:51 -05:00
James Rodewig e8a6d4a3fb
[DOCS] Remove unneeded redirects (#50476)
The docs/reference/redirects.asciidoc file stores a list of relocated or
deleted pages for the Elasticsearch Reference documentation.

This prunes several older redirects that are no longer needed and
don't require work to fix broken links in other repositories.
2019-12-26 07:49:41 -05:00
James Rodewig 11b1ebfd9e
[DOCS] Document `transport` and `http` node stats (#50473)
Documents the `transport` and `http` parameters returned by the
`_nodes/stats` API.
2019-12-26 07:41:23 -05:00
Lisa Cawley 6501338a9e
[DOCS] Remove redundant results from ML APIs (#50477) 2019-12-24 08:34:03 -08:00
Orhan Toy 48342740c5 [DOCS] Fixes "enables you to" typos (#50225) 2019-12-23 14:38:37 -05:00
James Rodewig 3460dc9542
[DOCS] Percentile aggs are non-deterministic (#50468)
Percentile aggregations are non-deterministic. A percentile aggregation
can produce different results even when using the same data.

Based on [this discuss post][0], the non-deterministic property stems
from processes in Lucene that can affect the order in which docs are
provided to the aggregation.

This adds a warning stating that the aggregation is non-deterministic
and what that means.

[0]: https://discuss.elastic.co/t/different-results-for-same-query/111757
2019-12-23 13:11:31 -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
James Rodewig a311018fbc
[DOCS] Remove outdated file scripts refererence (#50437)
File scripts were removed in 6.0 with #24627.

This removes an outdated file scripts reference from the conditional clauses section of the search templates docs.
2019-12-20 14:02:42 -05:00
Jack Conradson 75a5a0bbb9
Document use of context in put stored script (#50446)
This documents how to test compile a stored script against a specific 
context when using PUT/POST.
2019-12-20 10:52:44 -08:00
Igor Motov 7f81467378
Geo: Switch generated GeoJson type names to camel case (#50285) (#50400)
Switches generated GeoJson type names to camel case
to conform to the standard.

Closes #49568
2019-12-20 04:47:42 -10:00
Florian Kelbert 0778c34630 [DOCS] Fix typo in bucket sum aggregation docs (#50431) 2019-12-20 08:47:24 -05:00
Stuart Tettemer fb6ef69c6b
[DOCS] Deterministic scripted queries are cached (#50408)
Refs: #49321
2019-12-19 16:16:57 -07:00
Lisa Cawley 362ce41eaf
[DOCS] Updates ML links (#50387) 2019-12-19 14:47:28 -08:00
István Zoltán Szabó b8cae37374
[DOCS] Adds inference processor documentation (#50204)
Co-Authored-By: Lisa Cawley <lcawley@elastic.co>
2019-12-19 12:19:44 +01:00
Lee Hinman 5adbf67c08
Add ILM histore store index (#50287)
* Add ILM histore store index

This commit adds an ILM history store that tracks the lifecycle
execution state as an index progresses through its ILM policy. ILM
history documents store output similar to what the ILM explain API
returns.

An example document with ALL fields (not all documents will have all
fields) would look like:

```json
{
  "@timestamp": 1203012389,
  "policy": "my-ilm-policy",
  "index": "index-2019.1.1-000023",
  "index_age":123120,
  "success": true,
  "state": {
    "phase": "warm",
    "action": "allocate",
    "step": "ERROR",
    "failed_step": "update-settings",
    "is_auto-retryable_error": true,
    "creation_date": 12389012039,
    "phase_time": 12908389120,
    "action_time": 1283901209,
    "step_time": 123904107140,
    "phase_definition": "{\"policy\":\"ilm-history-ilm-policy\",\"phase_definition\":{\"min_age\":\"0ms\",\"actions\":{\"rollover\":{\"max_size\":\"50gb\",\"max_age\":\"30d\"}}},\"version\":1,\"modified_date_in_millis\":1576517253463}",
    "step_info": "{... etc step info here as json ...}"
  },
  "error_details": "java.lang.RuntimeException: etc\n\tcaused by:etc etc etc full stacktrace"
}
```

These documents go into the `ilm-history-1-00000N` index to provide an
audit trail of the operations ILM has performed.

This history storage is enabled by default but can be disabled by setting
`index.lifecycle.history_index_enabled` to `false.`

Resolves #49180
2019-12-18 16:09:59 -07:00
James Rodewig b8a62ce8f7
[DOCS] Document `thread_pool` node stats (#50330) 2019-12-18 16:57:38 -05:00
lcawl d8a94f0397 [DOCS] Fixes security links 2019-12-18 11:51:03 -08:00
Lisa Cawley 68e02a19d8
[DOCS] Move machine learning results definitions into APIs (#50257) 2019-12-18 09:50:31 -08:00
Igor Motov a26e4d1e5e
Geo: Switch generated WKT to upper case (#50285)
Switches generated WKT to upper case to
conform to the standard recommendation.

Relates #49568
2019-12-18 07:28:56 -10:00
James Rodewig a762c29dcf
[DOCS] Clarify frozen indices are read-only (#50318)
The freeze index API docs state that frozen indices are blocked for
write operations.

While this implies frozen indices are read-only, it does not explicitly
use the term "read-only", which is found in other docs, such as the
force merge docs.

This adds the "ready-only" term to the freeze index API docs as well
as other clarification.
2019-12-18 12:17:41 -05:00
Christoph Büscher 7f90ff64a3
[Docs] Remove `intervals` filter rule from allowed top-level rules (#50320)
The `filter` rule is not allowed on the top-level of the query, so removing it
from the list of allowed rules. Where it can be nested inside other rules, those
rules already mention it.
2019-12-18 17:35:35 +01:00
Adrien Grand 2d627ba757
Add per-field metadata. (#49419)
This PR adds per-field metadata that can be set in the mappings and is later
returned by the field capabilities API. This metadata is completely opaque to
Elasticsearch but may be used by tools that index data in Elasticsearch to
communicate metadata about fields with tools that then search this data. A
typical example that has been requested in the past is the ability to attach
a unit to a numeric field.

In order to not bloat the cluster state, Elasticsearch requires that this
metadata be small:
 - keys can't be longer than 20 chars,
 - values can only be numbers or strings of no more than 50 chars - no inner
   arrays or objects,
 - the metadata can't have more than 5 keys in total.

Given that metadata is opaque to Elasticsearch, field capabilities don't try to
do anything smart when merging metadata about multiple indices, the union of
all field metadatas is returned.

Here is how the meta might look like in mappings:

```json
{
  "properties": {
    "latency": {
      "type": "long",
      "meta": {
        "unit": "ms"
      }
    }
  }
}
```

And then in the field capabilities response:

```json
{
  "latency": {
    "long": {
      "searchable": true,
      "aggreggatable": true,
      "meta": {
        "unit": [ "ms" ]
      }
    }
  }
}
```

When there are no conflicts, values are arrays of size 1, but when there are
conflicts, Elasticsearch includes all unique values in this array, without
giving ways to know which index has which metadata value:

```json
{
  "latency": {
    "long": {
      "searchable": true,
      "aggreggatable": true,
      "meta": {
        "unit": [ "ms", "ns" ]
      }
    }
  }
}
```

Closes #33267
2019-12-18 17:27:38 +01:00
Kevin Woblick 77d94caa70 [DOCS] Add warning about Docker port exposure (#50169)
Docker bypasses the Uncomplicated Firewall (UFW) on Linux by editing the `iptables` config directly, which leads to the exposure of port 9200, even if you blocked it via UFW.

This adds a warning along with work-arounds to the docs.

Signed-off-by: Kovah <mail@kovah.de>
2019-12-18 09:03:44 -05:00
István Zoltán Szabó 50e26d40a2
[DOCS] Adds GET, GET stats and DELETE inference APIs (#50224)
Co-Authored-By: Lisa Cawley <lcawley@elastic.co>
2019-12-18 09:10:12 +01:00