Commit Graph

3214 Commits

Author SHA1 Message Date
Carlos Delgado 2412adf0fa
Fix synonyms API analyzers reloading (#97621) 2023-07-13 14:28:28 +02:00
elasticsearchmachine 528b883add Merge pull request ESQL-1433 from elastic/main
🤖 ESQL: Merge upstream
2023-07-13 01:22:45 -04:00
Kathleen DeRusso 1365b0df61
Enable Query Rules as technical preview (#97466)
Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>
2023-07-12 16:04:59 -04:00
elasticsearchmachine f00a6219d1 Merge pull request ESQL-1428 from elastic/main
🤖 ESQL: Merge upstream
2023-07-12 13:21:28 -04:00
eyalkoren 3d36b08d28
Fix `fields` API with `subobjects: false` (#97092) 2023-07-12 11:35:18 +03:00
Carlos Delgado a1c229a854
Synonyms API - allow empty rulesests (#97458) 2023-07-12 10:30:29 +02:00
elasticsearchmachine 46a2cab5f2 Merge pull request ESQL-1407 from elastic/main
🤖 ESQL: Merge upstream
2023-07-10 13:21:21 -04:00
Carlos Delgado d60e698f0d
Synonyms - Fixes error when no ID is specified (#97426) 2023-07-10 08:44:30 +02:00
Costin Leau 1f77e2ba56 Merge commit '6d45c57b8fc6d504fdc28f355c6db22ac811e629' into esql/lang 2023-07-08 15:53:01 +03:00
Pooya Salehi 34eb74fa23
Do not use auto_expand_replica in mget yaml rest tests (#97427)
As described in the issue, the change in #96763
has made the MixedClusterClientYamlTestSuiteIT for mget fail very
often. For now, let's take the same approach that we have for get.

Closes #97236
2023-07-07 14:44:36 +02:00
Carlos Delgado 86cc92a447
Synonyms API - Delete synonym rule (#97371) 2023-07-07 09:16:01 +02:00
elasticsearchmachine f294be3caf Merge pull request ESQL-1369 from elastic/main
🤖 ESQL: Merge upstream
2023-07-05 13:18:40 -04:00
Mary Gouseti a432313ff3
Data stream lifecycle class names (#97381) 2023-07-05 12:28:32 +03:00
elasticsearchmachine 882b4d8d83 Merge pull request ESQL-1362 from elastic/main
🤖 ESQL: Merge upstream
2023-07-03 16:42:52 -04:00
Mayya Sharipova b294348f10
Add synonyms feature for test clusters (#97334)
For snapshots builds we automatically enable all feature flags,
but for release builds they need to be explicitly added to
test clusters for tests.
This PR does it for synonyms feature.

Closes #96641, #97177
2023-07-03 15:33:54 -04:00
elasticsearchmachine c0fa87eed4 Merge pull request ESQL-1341 from elastic/main
🤖 ESQL: Merge upstream
2023-06-29 13:32:25 -04:00
Martijn van Groningen 9e4fb44a19
Improve error message when aggregation doesn't support counter field (#93545)
A number of aggregations don't support counter fields,
because its computation doesn't make sense on these fields.
For example computing an average on a counter doesn't make
sense.

Relates to #93539
2023-06-29 09:18:41 +02:00
elasticsearchmachine a10223cc99 Merge pull request ESQL-1337 from elastic/main
🤖 ESQL: Merge upstream
2023-06-28 13:16:49 -04:00
Christoph Büscher 8407e978c8
Mute some knn yml tests (#97191) 2023-06-28 16:23:35 +02:00
Mary Gouseti 1abd51b167
Start with data stream lifecycle documentation (#95326) 2023-06-28 16:18:05 +03:00
elasticsearchmachine a4c4f77205 Merge pull request ESQL-1323 from elastic/main
🤖 ESQL: Merge upstream
2023-06-26 13:22:25 -04:00
David Turner 87421f2d27
Add node.roles to cat allocation API (#96994)
`GET _cat/allocation` is a useful way to get a high-level view of the
balance of a cluster, but clusters are only balanced within each data
tier and today this API does not expose node roles. This commit adds an
optional `node.role` column to this API.
2023-06-26 05:23:57 -04:00
elasticsearchmachine 4030a5ef79 Merge pull request ESQL-1319 from elastic/main
🤖 ESQL: Merge upstream
2023-06-25 01:23:41 -04:00
Michael Peterson afbf1f5ca1
Profile API should show node details as well as shard details (#96396)
Added additional fields to SearchProfileResults for XContent output: node_id, cluster, index, shard_id.
It parses the existing composite ID using the new parseProfileShardId method, which reverses
the SeachShardTarget.toString method.

No new information is added here, merely the splitting out of the four pieces of information
in the profile shards "composite" id that is created by the SeachShardTarget.toString method.

Profile/shards output now has the form:
```
  "profile": {
    "shards": [
      {
        "id": "[2m7SW9oIRrirdrwirM1mwQ][blogs][0]",
        "node_id": "2m7SW9oIRrirdrwirM1mwQ",
        "shard_id": "0",
        "index": "blogs",
        "cluster": "(local)",
        "searches": [ ... ]
        ...
      },
      {
        "id": "[UngEVXTBQL-7w5j_tftGAQ][remote1:blogs][2]",
        "node_id": "UngEVXTBQL-7w5j_tftGAQ",
        "shard_id": "2",
        "index": "blogs",
        "cluster": "remote1",
        "searches": [ ... ]
        ...
```

where the latter is on a remote cluster and you can see that as the prefix on the index name.

Partially addresses #25896

Added yamlRestTest for the new fields in the profile response.
2023-06-24 14:12:25 -04:00
elasticsearchmachine 935e377a96 Merge pull request ESQL-1310 from elastic/main
🤖 ESQL: Merge upstream
2023-06-22 15:35:19 -04:00
elasticsearchmachine 7b664ea581 Merge pull request ESQL-1309 from elastic/main
🤖 ESQL: Merge upstream
2023-06-22 13:17:01 -04:00
Mayya Sharipova 11a3104a8c
Auto-reload analyzers for specific resource (#96986)
This PR adds a new optional parameter "resource" for ReloadAnalyzersRequest.
If used, only analyzers that use this specific "resource" will be reload.
This parameter is not documented, for internal use only.

PR #96886 introduced auto-reload of analyzers on synonyms index change. The problem
was that reloading was applied broadly for all indices that contained reloadable
analyzers. This PR improves this, so when a particular synonyms set changes,
only analyzers that use this synonyms set  will auto-reloaded. Note that shard
requests will still be sent to all indices shards, as only on a shard we can
decide if analyzers need to be reloaded.
2023-06-22 13:09:45 -04:00
Carlos Delgado a43af3e194
Synonyms API - Get Synonym Rule (#96985) 2023-06-22 18:55:47 +02:00
Kathleen DeRusso f5c4af547e
Add List Query Rulesets API Call (#96964) 2023-06-22 08:40:46 -04:00
elasticsearchmachine b9fe7e7e9f Merge pull request ESQL-1299 from elastic/main
🤖 ESQL: Merge upstream
2023-06-21 01:16:20 -04:00
elasticsearchmachine e133ae1309 Merge pull request ESQL-1296 from elastic/main
🤖 ESQL: Merge upstream
2023-06-20 13:20:47 -04:00
Carlos Delgado 75729363e2
Synonyms API - PUT Synonym Rule request (#96865) 2023-06-20 18:45:41 +02:00
Kathleen DeRusso cd2a69c032
Add API calls to Get, Delete Query Rulesets (#96849) 2023-06-20 09:02:28 -04:00
Nhat Nguyen ae24412b53 Merge remote-tracking branch 'upstream-elastic/main' into sync-main 2023-06-19 23:06:11 -07:00
Mayya Sharipova b508ee7886
Auto-reload synonym analyzers on synonyms updates (#96886)
Synonym Management API project

On changes of synonyms in a synonym set, auto-reload analyzers.
Note that currently all updateable analyzers will be reloaded, even
those that are not relevant for a synonyms set being updated.
2023-06-19 10:50:02 -04:00
elasticsearchmachine 60f6c68bcd Merge pull request ESQL-1284 from elastic/main
🤖 ESQL: Merge upstream
2023-06-16 01:14:58 -04:00
Kathleen DeRusso 163fa8c96b
Remove create parameter from put query ruleset API call (#96883) 2023-06-15 14:00:44 -04:00
elasticsearchmachine 56c0e62c85 Merge pull request ESQL-1283 from elastic/main
🤖 ESQL: Merge upstream
2023-06-15 13:13:46 -04:00
Kathleen DeRusso 008a9fc46d
Add Put Query Ruleset API call (#96812) 2023-06-15 10:37:18 -04:00
Craig Taverner 9dbce6f6c7
Asset tracking: geo_line for TSDB (#94954)
* WIP Started geo_line for TSDB work

Starting with YAML tests (which currently pass) and AggregatorTests
(currently failing, likely due to mistake in the tests)

* Update docs/changelog/94954.yaml

* WIP Refactoring to prepare for TSDB geo_line

* Created TimeSeries version of GeoLineAggregator, and wired it in so that time-series aggregations use it, but current behavior is still identical to non-time-series.
* Added both yaml and unit tests for testing that geo_line works with correct results in both time-series and non-time-series cases.
* Added additional tests to verify the grouping behaviour of time-series vs. terms aggs, and the combination of the two.

* WIP Refactoring to prepare for TSDB geo_line

* Started refactoring to re-use simplifier for all buckets

* Fixed bug with leaf collector not changing per segment

* Fixed bug with leaf collector not detecting bucket changes

The bucket id can change within a segment, so we need to detect this and save the geo_line.

* Renamed class since it no longer extends BucketedSort

The original geo_line relied on the BucketedSort for all intelligence.
The time-series geo_line uses none of that, and does its own memory management.

* Fixed bug with geo_point leaking between geo_line buckets

And enhanced unit tests to cover multiple groups

* Code review updates

* Verify that the sort field is specifically the TS timestamp

Only activate the time-series optimizations if the aggregation is both:
* Within a time-series aggregation (ie. tsid and @timestamp ordered)
* The geo_line sort field is @timestamp

* Allow geo_point time-series to skip sort config

Also disables the new geo_line for time-series even if the correct
sort and point fields are used if the point field is not explicitly
configured to be a position metric.

* Support geo_centroid and geo_bounds on position metric

* Update yaml tests for multi-terms tests

* Changed to disallow alternative sort-fields in ts-geo_line

Since the primary criteria for switching to the new algorithm is that
geo_line is within a time-series aggregation, we now disallow any other sort field.

We test the negative case in the yaml tests, but changed the unit tests to
use TermsAggregation to minim the time-series aggregation to get comparable
results.

* For non-time-series check missing sort field early

The old code only threw error if there was data because the check was done
inside the leaf collector just before actually reading the sort field.
And there were no tests for missing sort field.

This commit adds the tests, and checks early so even if data is missing.

* Reviewed TODOs

* Test that behaviour is identical with or without POSITION metric
* Removed fallback code in builder (was switching to old geo_line without POSITION metric)
* Removed two TODO's that are no longer valid concerns
2023-06-15 14:58:25 +02:00
Pooya Salehi 01731aec0c
Stateless real-time mget (#96763)
The mget counterpart of
https://github.com/elastic/elasticsearch/pull/93976.

Relates ES-5677
2023-06-15 05:56:02 -04:00
elasticsearchmachine df3a460935 Merge pull request ESQL-1279 from elastic/main
🤖 ESQL: Merge upstream
2023-06-15 01:16:31 -04:00
Volodymyr Krasnikov 674441ded8
Fix Node stats API metric name (#96815) 2023-06-14 10:03:34 -07:00
Nhat Nguyen 31949fcbde Merge remote-tracking branch 'elastic/esql/lang' into merge-main 2023-06-13 21:20:00 -07:00
Volodymyr Krasnikov 7abe8cb974
Add repo throttle metrics to node stats api response (#96678)
* Add repo throttle metrics to node stats api response

* Update docs/changelog/96678.yaml

* Change x-content output structure

* Fix test after merge from main

* Follow PR comments

* minor fixes

* minor fixes 2

* Introduce new TransportVersion (V_8_500_010)

* Fix yaml test

* Follow PR comments

* Make stats datapoints human readable

* Follow common pattern for human readable output

* Bump up TransportVersion
2023-06-13 09:04:36 -07:00
Carlos Delgado 6538bdcb82
Synonyms API - Synonyms Sets GET (#96587) 2023-06-13 10:07:30 +02:00
elasticsearchmachine 2a0b1acadb Merge pull request ESQL-1265 from elastic/main
🤖 ESQL: Merge upstream
2023-06-12 09:48:51 -04:00
Pablo Alcantar Morales 5a623ee3bf
Add `script` information to the cluster info endpoint (#96613)
Add a new target (`script`) to the `/_info` API. It consolidates all the script information from the cluster nodes and returns a summary at the cluster level (compared with `_nodes/stats/script` it lacks the `<node>` dimension).
2023-06-12 10:10:21 +02:00
elasticsearchmachine 094cad0376 Merge pull request ESQL-1257 from elastic/main
🤖 ESQL: Merge upstream
2023-06-09 13:12:27 -04:00
Martijn van Groningen 65dff5c4c2
Update yaml test skip version after #96461 was back ported (#96486) 2023-06-09 05:23:11 -04:00
elasticsearchmachine 09811a495b Merge pull request ESQL-1249 from elastic/main
🤖 ESQL: Merge upstream
2023-06-07 13:19:08 -04:00
Andrei Dan c632108aa1
Remove feature flag checks from DLM serialisation (#96583)
Remove feature flag checks from DLM serialisation.
2023-06-07 13:13:28 +01:00
elasticsearchmachine 4273502fa2 Merge pull request ESQL-1238 from elastic/main
🤖 ESQL: Merge upstream
2023-06-06 01:16:55 -04:00
Carlos Delgado e738e9085c
Synonyms API - DELETE Request (#96566) 2023-06-05 22:48:10 +02:00
elasticsearchmachine a33820ef10 Merge pull request ESQL-1233 from elastic/main
🤖 ESQL: Merge upstream
2023-06-05 11:17:45 -04:00
Carlos Delgado 533a2048f7
Synonyms API - GET request (#96467) 2023-06-05 10:27:34 +02:00
elasticsearchmachine 7d60aebf31 Merge pull request ESQL-1229 from elastic/main
🤖 ESQL: Merge upstream
2023-06-03 01:22:13 -04:00
Mayya Sharipova 432e9d581b
Synonyms Mngmt API: validation on adding synonyms (#96489)
PR #95895 implemented PUT request for adding synonyms, but left validation
for later. This adds simple validation for synonyms that is not
attached to specific analyzer: only checking that the format
of a synonym rule is correct.
2023-06-02 15:22:06 -04:00
elasticsearchmachine 2834c015cb Merge pull request ESQL-1219 from elastic/main
🤖 ESQL: Merge upstream
2023-06-01 13:16:52 -04:00
Martijn van Groningen e335cec2a8
Fix NPE when indexing a document that just has been deleted in a tsdb index (#96461)
Sometimes a segment only contains tombstone documents. In that case, loading min and max @timestamp field values can result into NPE. Because these documents don't have a @timestamp field.

This change fixes that by checking for the existence of the @timestamp field in the a segment's field infos.
2023-06-01 10:54:49 +02:00
Pablo Alcantar Morales f5d47ccb0d
Add `thread_pool` information to the cluster info endpoint (#96407)
Add a new target (thread_pool) to the /_info API. It consolidates all the thread pools information from the cluster nodes and returns a summary at the cluster level (compared with _nodes/stats/thread_pool it lacks the <node> dimension)
2023-06-01 10:47:39 +02:00
elasticsearchmachine 6e4de7df18 Merge pull request ESQL-1214 from elastic/main
🤖 ESQL: Merge upstream
2023-05-31 13:22:26 -04:00
Carlos Delgado 39b7b5eb56
Synonym Mgmnt API: PUT request (#95895) 2023-05-31 10:48:56 +02:00
elasticsearchmachine 74a48e5d5b Merge pull request ESQL-1193 from elastic/main
🤖 ESQL: Merge upstream
2023-05-27 01:22:12 -04:00
Yang Wang e5e2a0400f
REST spec and YAML tests for cross-cluster API key APIs (#96339)
This PR adds REST spec files and YAML tests for the new create and
update cross-cluster API key APIs.

Relates: #95714, #96085
2023-05-26 19:46:02 -04:00
elasticsearchmachine 0ebbf0f60e Merge pull request ESQL-1188 from elastic/main
🤖 ESQL: Merge upstream
2023-05-26 13:18:02 -04:00
Pablo Alcantar Morales 244da063ca
Add `ingest` information to the cluster info endpoint (#96328) 2023-05-26 09:28:12 +02:00
elasticsearchmachine ae12d77f32 Merge pull request ESQL-1173 from elastic/main
🤖 ESQL: Merge upstream
2023-05-24 13:16:43 -04:00
Ignacio Vera 0fdf12d4d7
API rest compatibility for type parameter in geo_bounding_box query (#96317)
The parameter was removed in version 8.0.0 but it should be supported in the Rest API with compatibility to v7
2023-05-24 15:33:22 +02:00
elasticsearchmachine cf6823de1b Merge pull request ESQL-1165 from elastic/main
🤖 ESQL: Merge upstream
2023-05-23 13:21:32 -04:00
Pablo Alcantar Morales 64e32679c8
Generalise new cluster info endpoint (#96259) 2023-05-23 16:30:56 +02:00
elasticsearchmachine 2ca31d3a8b Merge pull request ESQL-1163 from elastic/main
🤖 ESQL: Merge upstream
2023-05-22 13:27:17 -04:00
Pablo Alcantar Morales dc5d0546e9
New HTTP info (`/_info/http`) endpoint (#96198)
Adding a new endpoint under `_info/http`. This endpoint summarises the HTTP info of all the nodes into one big response, at cluster level. Compared with `_nodes/stats`, it lacks the nodes dimension.
2023-05-22 07:43:23 +02:00
Salvatore Campagna f42b7652bf
Search idle info transport version bump (#96213)
Include search idle info to shard stats (#95740)

Extend the Index Stats API to include information about shard idleness.
To be more precise we include two pieces of info:
* a boolean indicating if a shard is idle at the moment the API call takes place
* a long value indicating the time in milliseconds the shard has been search idle
  since the last time it went into search idle state
2023-05-19 15:10:37 +02:00
Mark Vieira bb23161ac2
Revert "Include search idle info to shard stats (#95740)" (#96204)
This reverts commit f523caf44d.

#95740 introduced a transport protocol change but using the old stack
version transport versions. This breaks inter-commit backward
compatibility. This pull request reverts this for now until we can go
back and reintroduce the change using a new transport version.
2023-05-17 13:31:40 -04:00
elasticsearchmachine 531bdd58d0 Merge pull request ESQL-1142 from elastic/main
🤖 ESQL: Merge upstream
2023-05-16 13:15:53 -04:00
Salvatore Campagna f523caf44d
Include search idle info to shard stats (#95740)
Extend the Index Stats API to include information about shard idleness.
To be more precise we include two pieces of info:
* a boolean indicating if a shard is idle at the moment the API call takes place
* a long value indicating the time in milliseconds the shard has been search idle
   since the last time it went into search idle state
2023-05-16 15:15:47 +02:00
elasticsearchmachine 7ce57001a4 Merge pull request ESQL-1111 from elastic/main
🤖 ESQL: Merge upstream
2023-05-10 13:21:06 -04:00
Przemyslaw Gomulka dc03c47ada
Refactor RestMainAction into separate module (#95881)
we want to allow overriding info (GET /) api in serverless, therefore this commit moves the RestMainAction and is transport classes into a module that has a rest plugin

Main endpoint is often used in testing to verfiy that a cluster is ready, hence this commit also has to add a testing dependency on main to a lot of modules

relates #95422
2023-05-10 14:39:00 +02:00
elasticsearchmachine a38a018ef8 Merge pull request ESQL-1095 from elastic/main
🤖 ESQL: Merge upstream
2023-05-05 13:19:17 -04:00
Mary Gouseti 4602570fda
Fix explain data lifecycle api spec (#95855) 2023-05-05 12:29:22 +02:00
elasticsearchmachine 069424b0c0 Merge pull request ESQL-1085 from elastic/main
🤖 ESQL: Merge upstream
2023-05-04 13:21:33 -04:00
Keith Massey 753e74c739
Using GET instead of POST for DLM explain API (#95804) 2023-05-04 08:05:04 -05:00
elasticsearchmachine 3ffa8fc730 Merge pull request ESQL-1081 from elastic/main
🤖 ESQL: Merge upstream
2023-05-03 13:32:09 -04:00
Mark Tozzi 2bec8511c3
quick note about the close_to operator (#95685) 2023-05-03 11:40:50 -04:00
elasticsearchmachine 7df7247d79 Merge pull request ESQL-1079 from elastic/main
🤖 ESQL: Merge upstream
2023-05-03 10:34:09 -04:00
Salvatore Campagna abba374b08
Fix skip version (#95616)
Indexing in TSDB changed in 8.2.0 so we need to skip mixed cluster
tests on versions before 8.2.0.
2023-05-03 09:51:05 +02:00
elasticsearchmachine 0bfcddf73f Merge pull request ESQL-1075 from elastic/main
🤖 ESQL: Merge upstream
2023-05-02 20:02:37 -04:00
Martijn van Groningen 8e9469abf2
Speed up indices stats yaml tests (#95708)
The tests in `13_fields.yml` file are taking a very long time in any test cluster with a single node.
This is because the create index api call in the test setup waits for all shards to be allocated.
Also for the replica shards and that never happens in a single node cluster.
The create index api waits for this to happen for 30 seconds.

This seems to be added a while ago when dealing with mixed cluster rest test failures.
No shards seem to be available in that past causing test failures.
But the subsequent cluster health api should be sufficient to ensure that at least one copy per shard is allocated.

This change also changes the number of shards from 3 to 2 (2 shards is sufficient for this test) and
bounds to cluster health api call only to test1 index.

Closes #95580
2023-05-02 13:58:27 +02:00
elasticsearchmachine e29bee0bd6 Merge pull request ESQL-1069 from elastic/main
🤖 ESQL: Merge upstream
2023-04-29 01:18:40 -04:00
Mary Gouseti ef7db10177
[DLM] Fix the new endpoint rest-api specification (#95665)
Fix the following mistakes in the rest-api specification for the new
endpoints.

- Changed the stability of the endpoints from stable to experimental.
- Removed the following paths that we decided we do not support.

Relates to: #93596
2023-04-28 08:16:39 -04:00
elasticsearchmachine 2e8d9a6479 Merge pull request ESQL-1067 from elastic/main
🤖 ESQL: Merge upstream
2023-04-28 01:18:54 -04:00
Michael Peterson 5169011325
Allow multiple field names/patterns for (path_)(un)match (#66364) (#95558)
* Allow multiple field names/patterns for (path_)(un)match (#66364)

Arrays of patterns are now allowed for dynamic_templates in the match,
unmatch, path_match and path_unmatch fields. DynamicTemplate has been modified to
support List<String> for these fields. The patterns can be either simple wildcards
or regex. As with previous functionality, when match_pattern="regex", simple wildcards
will be flagged with an error, but when match_pattern="simple", using regular expressions
in the match will not throw an error.

One new error pathway was added: if a user specifies a list of non-strings for
one of these pattern fields (e.g., "match": [10, false]) a MapperParserException
will be thrown.

A dynamic_template yamlRestTest was added. This is a BWC change, so the REST test
that uses arrays of patterns is limited to v8.9 and above.

Closes #66364.
2023-04-27 12:58:49 -04:00
elasticsearchmachine a46ffea412 Merge pull request ESQL-1063 from elastic/main
🤖 ESQL: Merge upstream
2023-04-27 01:15:20 -04:00
Kathleen DeRusso ba93ddb11d
Add _render_query API call for Search Applications (#95513) 2023-04-26 13:47:41 -04:00
elasticsearchmachine 5e04afc203 Merge pull request ESQL-1060 from elastic/main
🤖 ESQL: Merge upstream
2023-04-25 13:24:48 -04:00
Aurélien FOUCRET 2c5da510ec
[Behavioral Analytics] Add geo ip and user agent to events (#95433) 2023-04-25 18:42:29 +02:00
Jim Ferenczi 2c11c65765
Align enterprise search enabled setting name (#95540)
This commit aligns the name of the setting to enable enterprise search with similar settings (use underscore to separate words).
2023-04-25 15:26:33 +01:00
elasticsearchmachine cb15eec188 Merge pull request ESQL-1058 from elastic/main
🤖 ESQL: Merge upstream
2023-04-24 13:17:41 -04:00
Martijn van Groningen 6566bb4075
Add global ordinal info to stats APIs. (#94500)
This change adds:
* Total global ordinal build time for all fields and per field.
* Max shard value count per field. The value count is per shard and of the shard with the highest count. Reporting value on index level or across indices is too expensive to report or keep track of.

This is added to common stats, which
is exposed in several stats APIs.

The following api call:

```
GET /_nodes/stats?filter_path=nodes.*.indices.fielddata&fields=key,key2
```

Returns:

```
{
    "nodes": {
        "pcMNy4GsQ8ef6Rw-bI2EFg": {
            "indices": {
                "fielddata": {
                    "memory_size_in_bytes": 2552,
                    "evictions": 0,
                    "fields": {
                        "key2": {
                            "memory_size_in_bytes": 1320
                        },
                        "key": {
                            "memory_size_in_bytes": 1232
                        }
                    },
                    "global_ordinals": {
                        "build_time_in_millis": 8,
                        "fields": {
                            "key2": {
                                "build_time_in_millis": 4,
                                "shard_max_value_count": 4
                            },
                            "key": {
                                "build_time_in_millis": 4,
                                "shard_max_value_count": 4
                            }
                        }
                    }
                }
            }
        }
    }
}
```
2023-04-24 10:45:27 +02:00
elasticsearchmachine 28b4d081cb Merge pull request ESQL-1050 from elastic/main
🤖 ESQL: Merge upstream
2023-04-22 01:11:31 -04:00
Nhat Nguyen 55049fd10a
Wait for events in sort segments YAML test (#95478)
This PR is similar to #46586.

When waiting for no initializing shards we also have to wait for events
when we have more than one node in the cluster. When the primary is
started, there is a short period of time, where neither the primary nor
any of the replicas are initializing.
2023-04-22 00:31:59 -04:00
elasticsearchmachine e05d9a53d5 Merge pull request ESQL-1038 from elastic/main
🤖 ESQL: Merge upstream
2023-04-20 13:15:29 -04:00
Salvatore Campagna a721fcf80f
Fix error message and unmute test (#95411) 2023-04-20 13:41:20 +02:00
Salvatore Campagna e560b81754
mute: yaml test with incorrect error message (#95407)
Mute test.

See #95406
2023-04-20 06:54:18 -04:00
Mary Gouseti a432aa8df2
Revert "mute multiple tests (#95145)" (#95402) 2023-04-20 12:40:59 +02:00
Salvatore Campagna 1c609ac0f7
Support flattened fields as time series dimension fields (#95273)
Normally dimension fields are identified by means of a boolean parameter
at mapping time, time_series_dimension. Flattened fields do not have mappings,
other than identifying the top level field as a flattened field type. Moreover a boolean
is not enough to identify the top-level field as a dimension since we would like
users to be able to specify a subset of the fields in the flattened field to be dimensions
(not necessarily all of them). For this reason we introduce a new mapping parameter,
time_series_dimensions, which lists the fields, in any order, in the flattened field
that the user wants as dimensions. Field names must not include the root field name
and their name is the relative path from the root down to the leaf field name.

We require flattened fields to be indexed, to have doc values and disallow usage
of the ignore_above parameter together with time_series_dimensions.
2023-04-20 10:57:45 +02:00
Ievgen Degtiarenko c2c0ced9b1
Reset desired balance (#94525)
This introduces an endpoint to reset the desired balance.
It could be used if computed balance diverged from the actual one a lot 
to start a new computation from the current state.
2023-04-20 08:03:48 +02:00
elasticsearchmachine 240a526d8d Merge pull request ESQL-1034 from elastic/main
🤖 ESQL: Merge upstream
2023-04-19 13:16:54 -04:00
Carlos Delgado cf284036f5
Set Search Application API stability as "experimental" (#95379) 2023-04-19 18:10:12 +02:00
elasticsearchmachine 26ff9657b8 Merge pull request ESQL-1032 from elastic/main
🤖 ESQL: Merge upstream
2023-04-19 01:14:43 -04:00
Lee Hinman 947279445b
Add Watcher APIs for updating/retrieving settings (#95342)
The `.watches` index is a system index, which means that its settings
cannot be modified by the user. This commit adds APIs (`PUT
/_watcher/settings` and `GET /_watcher/settings`) that allow modifying
and retrieving a subset of index settings for the `.watches` index.

The settings that are currently allowed are `index.number_of_replicas`
and `index.auto_expand_replicas`, though more may be added in the
future.

Resolves https://github.com/elastic/elasticsearch/issues/92991
2023-04-18 17:22:46 -04:00
elasticsearchmachine 3d26f6193b Merge pull request ESQL-1027 from elastic/main
🤖 ESQL: Merge upstream
2023-04-18 13:18:14 -04:00
Hendrik Muhs 3524836311
[ML] integrate model download into put trained model API (#95281)
This PR enables downloading packaged models from `ml-models.elastic.co`,
an endpoint provided by Elastic. Elastic provided models begin with a
`.`, which is a private namespace that does not interfere with user
models(the `.` prefix is disallowed for them). If a user puts a packaged
model, the model gets automatically downloaded. For air-gaped
environments it is possible to load models from a file.

earlier changes: #95175, #95207
2023-04-18 03:29:45 -04:00
David Kyle 267e74ff25
[ML] Start, stop and infer with deployment ID (#95168)
A trained model deployment can be started with an optional deployment Id.
Deployment Ids and model Ids considered to be in the same namespace
and unique, a deployment id cannot be the same as any other deployment
or model Id unless it is the same as the model being deployed. When 
creating a new model, the id cannot match any models or deployments
2023-04-18 08:22:34 +01:00
Salvatore Campagna 726f2c4c37
Test time series index routing path corner cases (#95233) 2023-04-18 08:45:30 +02:00
elasticsearchmachine 6cd8f2a22d Merge pull request ESQL-1013 from elastic/main
🤖 ESQL: Merge upstream
2023-04-13 13:16:47 -04:00
Kathleen DeRusso 28e6d64ec3
Initial Search Application Search API with templates (#95026)
---------

Co-authored-by: Ioana Tagirta <ioana.tagirta@elastic.co>
Co-authored-by: Jim Ferenczi <jim.ferenczi@elastic.co>
Co-authored-by: cdelgado <carlos.delgado@elastic.co>
Co-authored-by: Sloane Perrault <sloane.perrault@gmail.com>
2023-04-13 11:56:27 +02:00
elasticsearchmachine 03885e527c Merge pull request ESQL-1008 from elastic/main
🤖 ESQL: Merge upstream
2023-04-12 13:19:03 -04:00
Aurélien FOUCRET 46f5ee4fd7
Behavioral Analytics - Fix failing YAML tests on main (#95193)
* Fix failing tests on main
2023-04-12 17:11:32 +02:00
Aurélien FOUCRET 675163b155
[Enterprise Search][Behavioral Analytics] Events ingest API (#95027) 2023-04-12 15:13:19 +02:00
elasticsearchmachine 46d2d55c81 Merge pull request ESQL-1001 from elastic/main
🤖 ESQL: Merge upstream
2023-04-11 13:17:10 -04:00
elasticsearchmachine ea0cc7abfc Merge pull request ESQL-1000 from elastic/main
🤖 ESQL: Merge upstream
2023-04-11 11:38:36 -04:00
Seth Michael Larson 5e4d703009
Use 'indices' namespace for the Explain Data Lifecycle API 2023-04-11 10:17:38 -05:00
Salvatore Campagna be5406a956
mute multiple tests (#95145) 2023-04-11 15:05:35 +02:00
Salvatore Campagna 0eeef45ea2
Synthetic source support for flattened fields (#94842)
Here we add synthetic source support for fields whose type is flattened.
Note that flattened fields and synthetic source have the following limitations,
all arising from the fact that in synthetic source we just see key/value pairs
when reconstructing the original object and have no type information in mappings:

* flattened fields use sorted set doc values of keywords, which means two things: 
   first we do not allow duplicate values, second we treat all values as keywords
* reconstructing array of objects results in nested objects (no array)
* reconstructing arrays with just one element results in a single-value field since we
   have no way to distinguish single-valued from multi-values fields other then looking
   at the count of values
2023-04-11 10:54:28 +02:00
elasticsearchmachine edf9932b28 Merge pull request ESQL-992 from elastic/main
🤖 ESQL: Merge upstream
2023-04-10 13:14:09 -04:00
Seth Michael Larson 68bcbb50b7
Align search application and behavioral analytics APIs with current guidelines 2023-04-10 11:02:39 -05:00
elasticsearchmachine c691cf8933 Merge pull request ESQL-983 from elastic/main
🤖 ESQL: Merge upstream
2023-04-07 01:19:06 -04:00
Josh Mock 282eb771e3
Remove broken URL for cat.component_templates API (#94993)
Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2023-04-06 13:26:13 -05:00
elasticsearchmachine 0c752ffa9b Merge pull request ESQL-979 from elastic/main
🤖 ESQL: Merge upstream
2023-04-05 13:17:12 -04:00
Jim Ferenczi ea14f15633
Update rest api spec for ent-search module (#95020)
This change sets the stability of ent-search APIs to beta and visibility to public.
It also removes the feature flag link since enabling the module is not considered as a feature flag
and the module is enabled by default.
2023-04-05 13:56:33 +01:00
elasticsearchmachine 0d2c6fd45c Merge pull request ESQL-968 from elastic/main
🤖 ESQL: Merge upstream
2023-04-04 13:28:26 -04:00
Mary Gouseti 99145bbe9c
Add new endpoints to configure data lifecycle on a data stream level. (#94590)
With PR we introduce CRUD endpoints which update/delete the data lifecycle on the data stream level. When this is updated it will apply at the next DLM run to all the backing indices that are managed by DLM.
2023-04-04 18:37:38 +02:00
elasticsearchmachine 960a923819 Merge pull request ESQL-965 from elastic/main
🤖 ESQL: Merge upstream
2023-04-04 11:28:33 -04:00
Carlos Delgado 7a782031c4
Add Enterprise Search Module (#94381)
Create base module for ent-search with CRUD APIs to manage behavioral analytics and Search Application.

---------

Co-authored-by: Jim Ferenczi <jim.ferenczi@elastic.co>
Co-authored-by: Aurélien FOUCRET <aurelien.foucret@gmail.com>
Co-authored-by: Kathleen DeRusso <63422879+kderusso@users.noreply.github.com>
Co-authored-by: Ioana Tagirta <ioanatia@users.noreply.github.com>
Co-authored-by: Joseph McElroy <joseph.mcelroy@elastic.co>
Co-authored-by: Aurelien FOUCRET <aurelien.foucret@elastic.co>
Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
2023-04-04 10:36:13 +01:00
Mary Gouseti 1af2f438a3
[DLM] Extend the simulate template API to support include defaults (#94861) 2023-04-04 11:25:35 +02:00
elasticsearchmachine 118f164e2e Merge pull request ESQL-957 from elastic/main
🤖 ESQL: Merge upstream
2023-03-31 13:20:05 -04:00
Alan Woodward 093e36c875
Introduce DocumentParsingException (#92646)
Document parsing methods currently throw MapperParsingException. This
isn't very helpful, as it doesn't contain any information about where the parse
error happened - it is designed for parsing mappings, which are realised into
java maps before being examined. This commit introduces a new exception
specifically for document parsing that extends XContentException, so that
it reports the current position of the parser as part of its error message.

Fixes #85083
2023-03-31 12:14:19 +01:00
elasticsearchmachine 91cac568cf Merge pull request ESQL-956 from elastic/main
🤖 ESQL: Merge upstream
2023-03-30 23:29:15 -04:00
Seth Michael Larson 79b0b834cf
Make id parameter optional in logstash.get_pipeline API 2023-03-30 15:29:24 -05:00
elasticsearchmachine 21fec823e5 Merge pull request ESQL-942 from elastic/main
🤖 ESQL: Merge upstream
2023-03-29 01:22:00 -04:00
Benjamin Trent f23b906891
Add new `similarity` field to `knn` clause in `_search` (#94828)
This adds a new parameter to `knn` that allows filtering nearest neighbor results that are outside a given similarity.

`num_candidates` and `k` are still required as this controls the nearest-neighbor vector search accuracy and exploration. For each shard the query will search `num_candidates` and only keep those that are within the provided `similarity` boundary, and then finally reduce to only the global top `k` as normal.

For example, when using the `l2_norm` indexed similarity value, this could be considered a `radius` post-filter on `knn`.

relates to: https://github.com/elastic/elasticsearch/issues/84929 && https://github.com/elastic/elasticsearch/pull/93574
2023-03-28 15:29:01 -04:00
elasticsearchmachine 02930e4cc9 Merge pull request ESQL-937 from elastic/main
🤖 ESQL: Merge upstream
2023-03-28 13:23:49 -04:00
Ievgen Degtiarenko 05847ce813
Add computed shard movement metric (#94662)
This should help us ensure that desired balance is not producing too many shard movements during computation (that could be a sign of unusual configuration or a bug) that could eventually result in actual cluster balance diverging far from the desired balance (separate change is still required to warn/reset if we are in fact far during reconciliation step).
2023-03-28 11:25:00 +02:00
elasticsearchmachine 581a95ca05 Merge pull request ESQL-930 from elastic/main
🤖 ESQL: Merge upstream
2023-03-28 01:18:44 -04:00
Andrei Dan 223385f887
Introduce a _lifecycle/explain API for data stream backing indices (#94621)
This adds an {index}/_lifecycle/explain API to retrieve information
about an index's status within its lifecycle.

The response looks like so:
```
"indices" : {
    ".ds-metrics-foo-2023.03.22-000001" : {
      "index" : ".ds-metrics-foo-2023.03.22-000001",
      "managed_by_dlm" : true,
      "index_creation_date_millis" : 1679475563571,
      "time_since_index_creation" : "843ms",
      "rollover_date_millis" : 1679475564293,
      "time_since_rollover" : "121ms",
      "lifecycle" : { },
      "generation_time" : "121ms"
    },
    ".ds-metrics-foo-2023.03.22-000002" : {
      "index" : ".ds-metrics-foo-2023.03.22-000002",
      "managed_by_dlm" : true,
      "index_creation_date_millis" : 1679475564351,
      "time_since_index_creation" : "63ms",
      "lifecycle" : { }
    }
  }
}
```
2023-03-27 08:44:40 +01:00
elasticsearchmachine c895597b2b Merge pull request ESQL-919 from elastic/main
🤖 ESQL: Merge upstream
2023-03-24 01:18:28 -04:00
Jim Ferenczi 2f29830cd3
Add the ability to return the score of the named queries (#94564)
This change adds a new rest parameter called `rest_include_named_queries_score` that when set, includes the score of the named queries that matched the document.
Note that with this change, the score of named queries is always returned when using the transport client. The rest level has the ability to set the format of
the matched_queries section for BWC (kept as is by default).

Closes #65563
2023-03-23 13:17:26 +00:00
elasticsearchmachine 853f134e5e Merge pull request ESQL-903 from elastic/main
🤖 ESQL: Merge upstream
2023-03-20 13:21:04 -04:00