Commit graph

12162 commits

Author SHA1 Message Date
Tanguy Leroux
33ff7b2cb8
[Docs] Indicate that CCR does not auto-follow existing indices, only newly created ones (#89498) 2022-09-07 01:43:19 +09:30
Armin Braun
06d4ef7df1
Use chunked REST serialization for large REST responses (#88311)
Adds chunked rest serialization infrastructure that tries to serialize
only what can be flushed to the channel right away instead of fully
materializing a response on heap first and then writing it to the channel.

Makes use of the new infrastructure for get-snapshots as an example use case.
2022-09-06 14:32:00 +02:00
Rene Groeschke
43e2852016
Update openjdk to 18.0.2.1 (#89535)
* Update openjdk to 18.0.2.1
* Update docs/changelog/89535.yaml
* Keep using download.oracle.com

After clarification, Java.net download urls disappear after newer major versions have been released
2022-09-06 10:12:25 +02:00
Armin Braun
317f06a6e2
Fork TransportRollupCapsAction to MANAGEMENT POOL (#89803)
We can't run these actions on the transport threads in their current form.
The fully deserialize the mapping for each index they inspect which will
take a massive amount of time if either a large number of indices or a large
number of fields (indices * fields_per_index) overall are inspected.
2022-09-06 08:09:35 +02:00
Anthony McGlone
492f5b1751
[DOCS] Update search_after section with an example (#89631)
* [DOCS] Update search_after section with an example

* Update docs/reference/search/search-your-data/paginate-search-results.asciidoc

Co-authored-by: Abdon Pijpelink <abdon@abdon.nl>

* Update docs/reference/search/search-your-data/paginate-search-results.asciidoc

Co-authored-by: Abdon Pijpelink <abdon@abdon.nl>

* Update docs/reference/search/search-your-data/paginate-search-results.asciidoc

Co-authored-by: Abdon Pijpelink <abdon@abdon.nl>

* [DOCS] Update search_after section with an example

* [DOCS] Update search_after example with a response with sort values

Co-authored-by: Abdon Pijpelink <abdon@abdon.nl>
2022-09-05 15:33:03 +02:00
David Turner
6e3fe01b5a
Reject unknown bulk actions (#89450)
Requests to the bulk API comprise a sequence of items, each of which
starts with a JSON object describing the item. This object includes the
type of action to perform with the item which should be one of `create`,
`update`, `index`, or `delete`. In earlier versions Elasticsearch would
ignore items with an unrecognized type, skipping the next line in the
request, but this lenient behaviour means that there is no way for the
client to associate the items in the response with the items in the
request, and in some cases it would cause the remainder of the request
to be parsed incorrectly.

With this commit, requests to the bulk API must comprise only items with
recognized types. Elasticsearch will reject requests containing any
items with an unrecognized type with a `400 Bad Request` error response.
2022-09-05 20:57:02 +09:30
Przemyslaw Gomulka
8e517da159
Extend the date rounding logic to be conditional (#89693)
Date rounding logic should take into account the fields that will be
parsed be a parser. If a parser has a DayOfYear field, the rounding logic
should not try to default DayOfMonth as it will conflict with DayOfYear

However the DateTimeFormatter does not have a public method to return
information of fields that will be parsed. The hacky workaround is
to rely on toString() implementation that will return a field info when
it was defined with textual pattern.

This commits introduced conditional logic for DayOfYear, ClockHourOfAMPM and HourOfAmPM

closes #89096
closes #58986
2022-09-05 10:36:42 +02:00
Henning Andersen
0302d2db2d
Autoscaling after clone fix (#89768)
* Autoscaling after clone fix

Autoscaling could start failing after a clone, if the source of
the clone is deleted.

* Update docs/changelog/89768.yaml

* Update docs/changelog/89768.yaml
2022-09-02 05:44:58 +02:00
debadair
ba14aaa004
[DOCS] Add simple dev setup instructions back to the README (#89714)
* [DOCS] Add Docker-based quickstart instructions to README & ES guide

* Removed attributes

* Added basic tutorial

* Fixed headings

* Edit

* [DOCS] Adding basic dev setup instructions to the ES guide

* Incorporated security config from Kibana docs

* Update README.asciidoc

Co-authored-by: Adam Locke <adam.locke@elastic.co>

* Update README.asciidoc

Co-authored-by: Adam Locke <adam.locke@elastic.co>

* Added callouts for version attributes

* Update README.asciidoc

Co-authored-by: Adam Locke <adam.locke@elastic.co>

* Update README.asciidoc

Co-authored-by: Adam Locke <adam.locke@elastic.co>

* Added README content to guide topic

* Snippet test fixes

* Incorporated review feedback

* Remove version

* Update docs/reference/setup/run-elasticsearch-locally.asciidoc

* Added info about security on by default

* Fix xrefs

* Update docs/reference/setup/run-elasticsearch-locally.asciidoc

* Fix headers

* Edits

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2022-09-01 16:49:05 -07:00
Kewang
3c6797f2d2
Docs: use correct index name for kuromoji docs
The document is `kuromoji` analyzer, not `nori` analyzer
2022-09-01 12:59:42 -05:00
Nik Everett
44693b05c4
Synthetic _source: support match_only_text (#89516)
This adds support for synthetic `_source` to the `match_only_text` field
type. When synthetic `_source` is enabled `match_only_text` fields
create a hidden stored field to contain their text. This should have
similar or better search performance for this specific field type,
though it will have slightly worse indexing performance because
synthetic `_source` is still writing `_recovery_source`, which means
we're writing the bits for this field twice.
2022-09-01 11:59:46 -04:00
Stuart Tettemer
e3f34dcac0
Script: Write Field API with basic path resolution (#89738)
Adds `WriteField` to the ingest context via `field(<path>)`.

`WriteField` implements APIs:

* `String` `getName()`: The path
 * `boolean` `exists()`: Does the path exist in the document?
 * `WriteField` `set(def)`: Set the value at the path, creates nested path elements if necessary
 * `WriteField` `append(def)`: Appends value to the path, creates nested path elements if necessary, the value at path is always a List after this call?
 * `boolean` `isEmpty()`: Does the path contain a value?
 * `int` `size()`: How many elements does the path contain?
 * `Iterator` `iterator()`: Iterate over all elements at the path.
 * `def` `get(def`): Get the value at the path if it exists, otherwise return the given default
 * `def` `get(int, def)`: Get the value at the path and index if it exists, otherwise return the given default
 * `boolean` `hasValue(Predicate)`: Is there a value at the path that passes the filter?
 * `WriteField` `transform(Function)`: Change all values at the path
 * `WriteField` `deduplicate()`: Remove duplicates from the path
 * `WriteField` `removeValuesIf(Predicate)`: Remove a values from the path that pass the filter
 * `WriteField` `removeValue(int)`: Remove the index from the path, if it exists

Some APIs remain unimplemented:
 * `void` `move(String)`
 * `void` `overwrite(String)`
 * `void` `remove()`

This change does not handle equivalent paths, which are paths that differ in the source but flatten to the same field in the indexed document.

Path resolution is basic, each path element is assumed to be a key in the current container, starting with the root.  If there is not an entry in the map at a given level, the algorithm checks to see if the remaining path exists as a flat key.  The nested then flat nature algorithm handles the common case of some or none nesting followed by flat keys.

Refs: #79155
2022-09-01 10:23:02 -05:00
Nik Everett
703571a4f1
Synthetic _source: support ignore_above (#89466)
This allows you to use `ignore_above` with `keyword` fields in synthetic
source. Ignored values are stored in a "backup" stored field and added
to the end of the list of results. This makes `ignore_above` work pretty
much the same way as it does when you don't have synthetic source. The
only difference is the order of the results. But synthetic source
changes the order of results anyway. That should be fine.
2022-09-01 10:43:34 -04:00
Dimitris Athanasiou
4bbe4eab2d
[ML] Return 408 when open/start APIs time out (#89775)
This changes the response status code from `500` to `408` when
the following ML APIs time out:

- open anomaly detection job
- start datafeed
- start data frame analytics

Closes #89585
2022-09-01 17:25:23 +03:00
Dimitris Athanasiou
9af107fff0
[Transform] Return 408 when start api times out (#89774)
This changes the response status code returned when the
start api times out from `500` to `408`.
2022-09-01 16:56:23 +03:00
István Zoltán Szabó
e244473962
[DOCS] Reworks aggregating data for faster performance page (#89575) 2022-09-01 13:59:05 +02:00
István Zoltán Szabó
cbda0a51c6
[DOCS] Adds text similarity task example to API docs (#89756) 2022-09-01 11:53:26 +02:00
Dimitris Athanasiou
b5504ea701
[ML] Lift limit of max number of classes for classification to 100 (#89755)
Limit was previously set to `30`. After the improvements in elastic/ml-cpp#2395
we now raist the limit to `100`.
2022-09-01 10:47:58 +03:00
Yang Wang
adf8e01286
Add info of effective roles in denial messages (#89680)
When an action is denied due to authorization error, the list of
assigned roles is shown in the error message. However, it is possible
that the effective roles are fewer or more than the assigned list: *
Fewer roles can happen when the role is not defined or the license does
not permit it * More roles can happen when anonymous access is enabled

This PR changes the error message to show the effective roles instead of
the assigned roles (whenever possible) to help troubleshooting. In
addition, it also reports any missing roles, i.e. roles that are
assigned but cannot be found.
2022-09-01 11:30:01 +09:30
Yang Wang
69a31da016
Grace period for user profile activation (#89566)
The user profile document is updated on each activate call even when
there is no actual content change because it always updates the
last_synchronized timestamp. This behaviour is intentional to track the
user's last login time (since Kibana calls to the activate API on user
login). Client must explicitly handle retries for version conflicts.
This is generally desirable. However, on each login there are often
multiple web components trying to call this API concurrently. This
results into more frequent version conflicts. Since these updates occur
in a short period of time, updating last_synchronized for each of them
does not really contribute a lot for tracking user login.

This PR introduces a grace period for the update behaviour (30 seconds
non-configurable) so that the update (on activate) is only performed
when either of the following is true:

* There are actual content changes
* Or it has been more than 30 seconds since last update
2022-09-01 11:26:00 +09:30
Nik Everett
734dae6d36
Fix partial reduce bug in ip_prefix (#89734)
This stops us from applying the `min_doc_count` operation on partial
reduction. If run it on partial reduction then we filter out results
that might have more docs arrive.

Closes #89686
2022-08-31 16:23:09 -04:00
Hendrik Muhs
8694393c0a
[Transform] Scheduler concurrency fix (#89716)
fix concurrency issue in transform scheduler, by combining the empty check
and the task getter

fixes #88991
2022-08-31 16:19:34 +02:00
István Zoltán Szabó
a23c77ceaa
[DOCs] Orders transform API parameters in alphabetical order. (#89746) 2022-08-31 11:42:07 +02:00
Albert Zaharovits
843dc58331
Fix allow_no_indices request option in special cases (#89622)
The `allow_no_indices` request option, when set to `false` (it is `true`
by default for all APIs), should fail indices requests that contain any
wildcard expression that resolves to no resources. This PR addresses
some cases where a wildcard can expand to no resources, and the request
is nevertheless successful. The fixed cases are when the wildcard
resolves only to hidden and/or system resources and the given request
context prohibits such resources. Another case is when the wildcard
resolves to only open or closed indices and again the request context
prohibits such resources.

Note that the fix only applies when Security is disabled (when enabled
the behavior is  already correct).

This is another step towards reusing the Core's
`WildcardExpressionResolver#innerResolve` in Security, following
https://github.com/elastic/elasticsearch/pull/89311 .
2022-08-31 18:41:23 +09:30
Yang Wang
80c6d9faea
Option to return profile uid in GetUser response (#89570)
This PR adds a new query parameter to the GetUser API to optionally return
profile uid for each user if there is an associated profile.
2022-08-31 12:19:54 +10:00
Jack Conradson
8c30b86fe2
Fix bug for kNN with filtered aliases (#89621)
This change adds the filter query for a filtered alias to the knn query during the dfs phase on the 
shard. This ensures the correct number of k results are returned instead of removing results as a post 
filter.

Fixes: #89561
2022-08-30 15:57:37 -07:00
Lee Hinman
6161447659
Fix pipeline id not present in ingest metadata inside on_failure block (#89632)
This commit fixes an issue where inside of an `on_failure` block the
`_ingest.on_failure_pipeline` metadata was not being propagated. The
root cause seems to be an off-by-one error where we were checking for at
least two pipelines, when we should be checking for only a minimum of a
single pipeline that has been executed before adding the metadata.
2022-08-31 04:51:55 +09:30
debadair
30bb54a4e2
[DOCS] Remove coming tag from 8.4.1 RNs (#89727)
* [Doc] Release notes for v8.4.1 (#89636)

* [Doc] Release notes for v8.4.1

Gradle generated release notes for v8.4.1

* address feedback

* [DOCS] Remove coming tag for 8.4.1 RNs

Co-authored-by: Yang Wang <yang.wang@elastic.co>
2022-08-30 08:00:08 -07:00
debadair
e0fe6de63a
[Doc] Release notes for v8.4.1 (#89636) (#89726)
* [Doc] Release notes for v8.4.1

Gradle generated release notes for v8.4.1

* address feedback

Co-authored-by: Yang Wang <yang.wang@elastic.co>
2022-08-30 07:59:04 -07:00
Andrei Dan
7edf5aa750
[DOCS] health api details descriptions (#89553) 2022-08-30 15:55:18 +01:00
Nik Everett
104f4e9fb5
Synthetic _source: support version field type (#89706)
This adds support for synthetic _source to the `version` field type. It
works very similarly to `keyword` but with an extra decode step.

I modified the decoder to return a `BytesRef` instead of a `String`
because many of the callers seemed to be converting that string directly
into bytes again. Synthetic source would have wanted to do that. As was
the query infrastructure.
2022-08-30 09:39:50 -04:00
Abdon Pijpelink
e891909dfa
[DOCS] Explain dynamic behavior for unmapped copy_to fields (#89626)
* [DOCS] Explain dynamic behavior for unmapped copy_to fields

* Review suggestions
2022-08-30 15:15:35 +02:00
Aleksandr Maus
4b4116533a
Fleet: Add new mappings for .fleet-agents last_checkin_message and components fields (#89599)
* Fleet: Add new mappings for .fleet-agents last_checkin_message and components fields

* Update docs/changelog/89599.yaml

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2022-08-30 08:52:02 -04:00
Przemyslaw Gomulka
bc4c6784dd
Stable Plugin API modules and analysis interfaces (#88775)
This commit adds stable analysis plugin API with analysis components interfaces and annotations.
It does not contain any usage of it yet. Separate changes to introduce example plugins or refactoring to existing ones will follow later.

It contains two gradle modules. One plugin-api with two annotations Nameable and NamedComponent, which can be reused for plugins other than analysis.
And second analysis-plugin-api which contains analysis components (TokenFilterFactory, CharFilterFactory etc)

NamedComponent - used by plugin developer - indicates that a Nameable component will be registered under a given name.
Nameable - for analysis plugins it is only used by the stable analysis api designers (ES) - indicates that component have a name and should be declared with NamedComponent

additional tasks that will follow: #88980
2022-08-30 11:04:39 +02:00
debadair
cda5ce42aa
remove 8.3.0 coming tag (#89701) 2022-08-29 12:32:14 -07:00
Leaf-Lin
78d9d6844f
[DOCS] Add warning on restarting nodes exceeding low disk watermark (#89018)
* Create restart-cluster.asciidoc

As per https://github.com/elastic/elasticsearch/issues/49972 and https://github.com/elastic/elasticsearch/issues/56578, if a node is above low disk threshold when being restarted (rolling restart, network disruption or crash), the disk threshold decider prevents reusing the shard content on the restarted node.

The consequence of the event is the node may take a long time to start.

* Update docs/reference/setup/restart-cluster.asciidoc

LGTM! Thanks!

Co-authored-by: Adam Locke <adam.locke@elastic.co>

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2022-08-29 15:14:44 -04:00
David Kilfoyle
2a44a8982f
[DOCS] Remove feature flag from TSDS docs (#89673)
* Docs: Remove feature flag and add preview label to TSDS docs

* Fix technical preview tag
2022-08-29 10:33:55 -04:00
Nikola Grcevski
94d7a31873
Fix FileSettingsService hang on error update (#89630) 2022-08-29 10:23:19 -04:00
Abdon Pijpelink
772784f3c9
[DOCS] Add note that terms enum API may return terms from deleted docs (#89654) 2022-08-29 15:19:04 +02:00
Mayya Sharipova
724b76f7b8
Upgrade to lucene-9.4.0-snapshot-923a9f800ae (#89427)
Upgrade ES to a new Lucene snapshot:
Changes of interest:
- LUCENE-10592 Build HNSW Graph on indexing
- LUCENE-10678: Fix potential overflow when computing the partition point
- LUCENE-10633: Dynamic pruning for sorting on SORTED(_SET) fields
2022-08-29 09:10:47 -04:00
István Zoltán Szabó
9a71d1fa78
[DOCS] Clarifies retention policy for transforms (#89685) 2022-08-29 13:17:15 +02:00
István Zoltán Szabó
accf737145
[DOCS] Adds unattended setting to transforms API docs. (#89335) 2022-08-29 11:46:52 +02:00
QY
cdcf238787
Remove unexpected meta param in agg's response (#89467)
Only output the `meta` param from aggs if it was sent in the request.
2022-08-26 15:57:51 -04:00
tmgordeeva
db5ddb321f
Synthetic source error on script loads (#88334)
* Source Lookup refactor with error on script synthetic source load

Refactors SourceLookup into a static source lookup used for most cases where we
access the source again after the fetch phase, and a re-loading lookup used by
scripts. The re-loading lookup now also fails with an error when we are using
synthetic source preventing silent failures or non-sensical behavior from
scripts.
2022-08-26 11:32:53 -07:00
Nik Everett
0683c90ded
REST tests for normalize agg (#89629)
This adds a REST test for the normalize pipeline agg so we have
backwards compatibility tests for it.
2022-08-26 14:18:46 -04:00
Lisa Cawley
8fd9c5a096
[DOCS] Add ml-cpp PRs to release notes (#89663) 2022-08-26 09:15:34 -07:00
Luigi Dell'Aquila
afefcbcb49
Update changelog (release highlight) for #89106 (#89649) 2022-08-26 18:11:25 +02:00
Mary Gouseti
cdf4e07ba5
Copy isHidden during ILM alias swap (#89650)
Resolves #89604
2022-08-26 16:46:40 +02:00
Pooya Salehi
b501bfc26d
Mute DocsClientYamlTestSuiteIT test {yaml=reference/ilm/apis/get-lifecycle/line_49} (#89640)
Relates https://github.com/elastic/elasticsearch/issues/89623
2022-08-26 18:45:28 +09:30
Dimitris Athanasiou
3fca120092
[ML] Return 408 when start deployment api times out (#89612)
This commit changes the status code returned when the start
trained model deployment api times out from `500` to `408`.
In addition, we add validation that the timeout must be positive.

Relates #89585
2022-08-25 19:16:43 +03:00