Commit Graph

87547 Commits

Author SHA1 Message Date
Mark Vieira 7d4ba31681
Document logs essentials restricted ESQL commands for Kibana (#130346) 2025-07-01 16:29:01 -07:00
Larisa Motova 8b6acd06f4
[ES|QL] Fix suggested_cast yaml test (#130404)
The wrong capability name was being used in this yaml test
causing it to be skipped. This commit fixes that.
2025-07-01 12:24:27 -10:00
Ryan Ernst 4b7de2fa30
Add http-only headers to ElasticsearchException (#130348)
When return an error from Elasticsearch exceptions may contain values
written as http response headers. ElasticsearchException contains a map
of headers that are added to the response. But these values are also
written to a special "header" section of the response body.

This commit renames the existing "headers" in ElasticsearchException to
"body headers", which are both http headers and written to the response
body. A new "http headers" is added for headers that should only be
written as response headers.
2025-07-01 15:03:08 -07:00
Benjamin Trent a6dfe64652
Fix sampling for kmeans and address assignment edge case (#130405)
This is three fixes:

 - We should be doing actual sampling when doing kmeans clustering, taking the first N vectors creates some weird edge cases
 - Having assignments initialized as `0` means that if a vector gets assigned to cluster ord `0`, that cluster centroid actually isn't updated later in the lloyd steps. So, this initializes assignments to -1
 - If we actually don't sample the vectors for lloyd, don't bother with final pass to potentially update the centroids
2025-07-02 06:54:46 +10:00
Benjamin Trent 044f34bf3e
Refactor bulk quantization writing into a unified class (#130354)
this is a small refactor, laying ground work for more generalized bulk
writing.

I did some benchmarking and there was no significant performance
difference (as expected).
2025-07-02 06:53:45 +10:00
Benjamin Trent c1a4f8ae68
Fix multi-indexing runs for checkVec (#130408)
We now can do multiple query time parameters, but this sort of broke
running multiple indexing loads. 

This corrects multiple indexing & search tests for the KnnIndexTester:

Example output.

```
index_name                           index_type  num_docs  index_time(ms)  force_merge_time(ms)  num_segments
-----------------------------------  ----------  --------  --------------  --------------------  ------------
corpus-quora-E5-small.fvec.flat             ivf    100000            4386                  4522             0
cohere-wikipedia-docs-768d.vec              ivf    100000            7784                  8331             0
corpus-dbpedia-entity-arctic-0.fvec         ivf    100000            7513                  8969             0

index_name                           index_type  n_probe  latency(ms)  net_cpu_time(ms)  avg_cpu_count      QPS  recall   visited
-----------------------------------  ----------  -------  -----------  ----------------  -------------  -------  ------  --------
corpus-quora-E5-small.fvec.flat             ivf       10         0.87              0.00           0.00  1149.43    0.88   5511.60
corpus-quora-E5-small.fvec.flat             ivf       20         0.73              0.00           0.00  1369.86    0.94  10101.70
corpus-quora-E5-small.fvec.flat             ivf       30         0.76              0.00           0.00  1315.79    0.95  14382.15
corpus-quora-E5-small.fvec.flat             ivf       40         0.84              0.00           0.00  1190.48    0.96  18554.68
corpus-quora-E5-small.fvec.flat             ivf       50         0.99              0.00           0.00  1010.10    0.97  22609.69
cohere-wikipedia-docs-768d.vec              ivf       10         0.39              0.00           0.00  2564.10    0.61   2567.00
cohere-wikipedia-docs-768d.vec              ivf       20         0.53              0.00           0.00  1886.79    0.78   5017.25
cohere-wikipedia-docs-768d.vec              ivf       30         0.66              0.00           0.00  1515.15    0.84   7486.77
cohere-wikipedia-docs-768d.vec              ivf       40         0.80              0.00           0.00  1250.00    0.88  10177.80
cohere-wikipedia-docs-768d.vec              ivf       50         0.95              0.00           0.00  1052.63    0.90  12744.67
corpus-dbpedia-entity-arctic-0.fvec         ivf       10         0.48              0.00           0.00  2083.33    0.62   3302.07
corpus-dbpedia-entity-arctic-0.fvec         ivf       20         0.66              0.00           0.00  1515.15    0.74   6333.91
corpus-dbpedia-entity-arctic-0.fvec         ivf       30         0.78              0.00           0.00  1282.05    0.81   9545.16
corpus-dbpedia-entity-arctic-0.fvec         ivf       40         0.93              0.00           0.00  1075.27    0.85  12786.62
corpus-dbpedia-entity-arctic-0.fvec         ivf       50         1.08              0.00           0.00   925.93    0.87  15749.40
```
2025-07-02 05:58:32 +10:00
James Baiera 2144baeb8c
[Streams] Add new ingest pipeline field access flag (#129096)
This PR introduces a new flag to ingest pipeline configurations which will be used to control how 
fields are accessed from within that pipeline.
2025-07-01 15:50:53 -04:00
Parker Timmins 3a69d45892
Add test for matching middle key bug (#130396)
There was a bug in previous version where flattened fields would produce incorrect synthetic source with too few opening braces. This bug was fixed as a side effect of #129600. Adding this test to confirm. See #129600 for a full explanation.
2025-07-01 14:24:48 -05:00
Graeme Mjehovich 416405877f
Add age_in_millis to ILM Explain Response (#128866)
* Add age_in_millis to ILM Explain Response

* Fix: Declare age_in_millis in ILM Explain Response Parser

* Add unit tests for age_in_millis field in IndexLifecycleExplainResponse

* Update docs/changelog/128866.yaml

* Update docs/changelog/128866.yaml

* Update IndexLifecycleExplainResponse.java

Fix comments; follow DRY for getAge(nowSupplier) call in IndexLifecycleExplainResponse

---------

Co-authored-by: Joe Gallo <joe.gallo@elastic.co>
2025-07-01 13:42:38 -04:00
Keith Massey ae450dad20
Correctly handling data stream settings when component templates are used (#130394) 2025-07-01 12:40:37 -05:00
Liam Thompson 137eac554f
[DOCS] Update esql docs readme with 9.x+ version differentiation guidance (#130340) 2025-07-01 18:15:57 +02:00
Niels Bauman 2404dac592
Make deprecation plugin project-aware (#130364)
Updates the majority of the plugin to be aware of multiple projects.

The deprecation plugin is excluded in serverless, so in
`DeprecationIndexingComponent` we hard-code the default project ID to
avoid an unworthy investment of namespacing effort.
2025-07-01 12:08:48 -03:00
Ankit Sethi 6520fa2b7c
Add cloud API keys to auth info report (#130041)
* add change and test

* improve test
2025-07-01 09:45:54 -05:00
Julian Kiryakov 1e6473a427
[DOCS][ESQL] Add versions to the docs for LIKE LIST (#130299)
Clarifies the version applicability for new LIKE function alternative syntax with a list of patterns, added in #129170
2025-07-01 09:22:33 -04:00
Joshua Adams 5c8c001c58
Add Cluster Allocation Explain API Tests (#130381)
Add Cluster Allocation Explain API Tests

Adds tests for the `cluster/allocation/explain` API for when non-integer values are passed as the integer expected shard parameter. This change does not modify the `cluster/allocation/explain` API itself.
2025-07-01 14:01:08 +01:00
Niels Bauman 19708c1e9c
Make rollup APIs project-aware (#130365)
Updates the rollup APIs to work in a multi-project context (even though
that will never actually happen, as rollup is deprecated and the plugin
is excluded in serverless).
2025-07-01 09:36:02 -03:00
Nik Everett c0744a1808
Don't build can_match queries we can't push to data nodes (#130210)
Passes the minimum transport version down to expressions when
we convert them into queries that we'll use for can_match.
Right now all this is used for is skipping the can_match from
the wildcard like queries. The queries we make there aren't
serializable. We'll fix that - but this should give us the
levers that we need to do it in a backwards incompatible way.
2025-07-01 08:05:20 -04:00
Tommaso Teofili 9edfa6642a
Wrap ES KNN queries with PatienceKNN query (#127223) 2025-07-01 13:56:55 +02:00
Nhat Nguyen 31531952b4
Delay publishing time-series docs (#130367)
This change delays publishing the ES|QL documentation for time-series 
aggregations and the TS command until we are ready.
2025-06-30 23:25:40 -07:00
Niels Bauman 01b6de30d9
Clean up x-pack multi-project YAML test mutes some more (#130355)
These tests were already passing.
2025-07-01 10:24:35 +10:00
Stanislav Malyshev 3b13977343
Fix queries with missing index, skip_unavailable and filters (#130344)
* Fix queries with missing index, skip_unavailable and filters
2025-06-30 17:55:17 -06:00
Niels Bauman 8bd4645eff
Make XPackUsage APIs project-aware (#130358)
Updates the APIs to be able to handle multiple projects. This commit
does not guarantee that every sub-API returns sensible results in a
multi-project context. Some APIs/features potentially require further
work to return sensible data for multiple projects.

Since this API is for internal use only in serverless, we can check at a
later time whether any features require additional work.
2025-07-01 08:47:15 +10:00
Parker Timmins f88aaa34e7
Only run patterned_text mapper test if feature flag enabled (#130214) 2025-06-30 16:40:05 -05:00
Ryan Ernst bc393b9b91
Handle createLink post security manager in StoreRecoveryTests (#129964)
When running under security manager an assumptionw as made that failing
to create a hard link due to security exception implied hard links were
supported. Now that security manager is gone, the code to create a hard
link in StoreRecoveryTests executes. But in the case of windows,
BasicFileAttributes.fileKey does not return a unique object that can be
used to verify a link exists. Yet the fact createLink returned is enough
to trust the jdk was able to create a link.

closes #124104
2025-06-30 23:31:50 +02:00
elasticsearchmachine 53a41dbe14 Mute org.elasticsearch.multiproject.test.CoreWithMultipleProjectsClientYamlTestSuiteIT test {yaml=nodes.stats/11_indices_metrics/Lucene segment level fields stats} #130360 2025-07-01 06:40:04 +10:00
Ankit Sethi afbcaff788
Feature/prevent create api with cloud api key (#129966)
* [UIAM] Cloud API key authentication

* Clean up

* Nit

* Fix more tests

* Nit

* Fix sig

* Fix not

* Nit

* Authenticator

* More

* Javadoc

* Javadoc

* Fix tests

* Exception handling

* Javadoc

* add new transport version

* add todo to followup in ES-11961

* test cloud API key authentication serialization

* add a validation

* fix merge

* fix merge

* code review feedback + test

* Update x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java

Co-authored-by: Slobodan Adamović <slobodanadamovic@users.noreply.github.com>

* Update x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java

Co-authored-by: Slobodan Adamović <slobodanadamovic@users.noreply.github.com>

* [CI] Auto commit changes from spotless

---------

Co-authored-by: Nikolaj Volgushev <n1v0lg@users.noreply.github.com>
Co-authored-by: Slobodan Adamovic <slobodan.adamovic@elastic.co>
Co-authored-by: Slobodan Adamović <slobodanadamovic@users.noreply.github.com>
Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-06-30 15:22:51 -05:00
Niels Bauman 1585c4b8dc
Unmute `PermissionsIT` tests (#130345)
These failing tests were already addressed in #129506.

Resolves #129471 Resolves #129479 Resolves #129480 Resolves #129481
2025-07-01 05:17:51 +10:00
Niels Bauman 4790cf4c3e
Make ESQL match operator project-aware (#130331)
And unmute the YAML tests in the MP suite.
2025-06-30 15:19:54 -03:00
Jim Ferenczi 2142915fcb
Speed up (filtered) KNN queries for flat vector fields (#130251)
For dense vector fields using the `flat` index, we already know a brute-force search will be used—so there’s no need to go through the codec’s approximate KNN logic. This change skips that step and builds the brute-force query directly, making things faster and simpler.

I tested this on a setup with **10 million random vectors**, each with **1596 dimensions** and **17,500 partitions**, using the `random_vector` track.
The results:

### Performance Comparison

| Metric            | Before    | After      | Change    |
| ----------------- | --------- | ---------- | --------- |
| **Throughput**    | 221 ops/s | 2762 ops/s | 🟢 +1149% |
| **Latency (p50)** | 29.2 ms   | 1.6 ms     | 🔻 -94.4% |
| **Latency (p99)** | 81.6 ms   | 3.5 ms     | 🔻 -95.7% |

Filtered KNN queries on flat vectors are now over 10x faster on my laptop!
2025-06-30 19:19:35 +01:00
Keith Massey ff52007996
Adding rest actions for getting and updating data stream mappings (#130241) 2025-06-30 13:05:13 -05:00
Ioana Tagirta a2393063c0
ES|QL: Add docs for FORK (#130314)
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-06-30 20:04:21 +02:00
Joe Gallo d69a2822a0
Make the datastream reindexing APIs multi-project aware (#130035) 2025-06-30 14:04:10 -04:00
Gal Lalouche 26c4354666
ESQL: TopNOperator, release Row on failure (#130330)
Handles the case where the Row was released on failure, by moving the declaration to a try-with-resource clause.

Resolves #130215, #130222, #130270.
2025-07-01 02:40:45 +10:00
Niels Bauman 80062dc364
Fix continuously running ILM tasks in `DataStreamsUpgradeIT` (#130283)
The ILM policies on these data streams were causing issues during the
test cleanup phase. See
https://github.com/elastic/elasticsearch/issues/129097#issuecomment-3016122739
for more info.

Fixes #129097
Fixes #129098
2025-06-30 13:23:19 -03:00
Nhat Nguyen 6de476a88a
Add tests and docs for first/last_over_time and rate (#130290)
This PR adds unit tests and docs for first_over_time, last_over_time, 
and rate. For the rate function, the tests currently only verify that
the output is a double, not the actual value.
2025-06-30 09:22:13 -07:00
Tim Rühsen c370c05ae4
[Profiling] Ignore events count value (#130293)
* [Profiling] Ignore events count value

* [CI] Auto commit changes from spotless

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-06-30 17:58:41 +02:00
Ryan Ernst 40841edfdf
Handle newlines in release notes test (#130134)
Newlines are system dependent. The release notes generator uses groovy's
template engine, which produces system dependent newlines. This commit
adjusts the test to account for newlines on both windows and nix
systems.
2025-06-30 08:37:02 -07:00
Graeme Mjehovich a43aaa8417
Enhancement: ILM sets indexing_complete to true from ReadOnly action (#129945)
* ILM sets indexing_complete from ReadOnly action

* Update docs/changelog/129945.yaml

---------

Co-authored-by: Joe Gallo <joe.gallo@elastic.co>
2025-06-30 11:17:21 -04:00
Benjamin Trent 50c2cd3e47
Add more test coverage for nested searches over flat vector indices (#130263)
PR https://github.com/elastic/elasticsearch/pull/130251 made me realize
we were missing some important coverage.

This adds nested vector query (and top level knn) tests for flat indices
in our yaml tests.
2025-07-01 01:01:53 +10:00
Martijn van Groningen b6e518f01a
Remove tmp_fdt_no_mmap feature flag. (#130308)
After running this change for a week,
no regressions where detected in
nightly benchmarks that use index sorting.
2025-06-30 16:07:17 +02:00
Bogdan Pintea 78368266d6
ESQL: Extend the check on partial results to all REST ITs (#130213)
This extends the check that no partial results are returned to the rest
of the JSON-based REST ITs.

Related: #129293
2025-06-30 23:22:00 +10:00
Keith Massey fe2d6dfcf7
Avoid using data stream mappings if feature flag is disabled (#130261) 2025-06-30 08:07:11 -05:00
Ignacio Vera 7bc215aa49
Add nProbe to `:qa:vector:checkVec` and allow multiple nProbes (#130316)
This change adds the n_probe value to the output which will be 0 in the
case of non-ivf runs. In addition it separates index and search data, so
a normal output looks like:

```
index_type  num_docs  index_time(ms)  force_merge_time(ms)  num_segments
----------  --------  --------------  --------------------  ------------  
ivf          1000000           50382                132819             0

index_type  n_probe  latency(ms)  net_cpu_time(ms)  avg_cpu_count     QPS  recall   visited
----------  -------  -----------  ----------------  -------------  ------  ------  --------  
ivf             100         3.69              0.00           0.00  271.00    0.97  58917.00
```

In addition, this change allows to define an array of n_probe in the
configuration file so we can test different values in the same run, so
for example defining an n_probe like:

```
  "n_probe" : [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
```

will produce the following output:

```
index_type  num_docs  index_time(ms)  force_merge_time(ms)  num_segments
----------  --------  --------------  --------------------  ------------  
ivf          1000000           50382                132819             0

index_type  n_probe  latency(ms)  net_cpu_time(ms)  avg_cpu_count     QPS  recall   visited
----------  -------  -----------  ----------------  -------------  ------  ------  --------  
ivf              10         1.18              0.00           0.00  847.46    0.82   7244.59
ivf              20         1.36              0.00           0.00  735.29    0.89  13288.69
ivf              30         1.66              0.00           0.00  602.41    0.92  19266.67
ivf              40         1.93              0.00           0.00  518.13    0.94  24995.41
ivf              50         2.21              0.00           0.00  452.49    0.94  30739.60
ivf              60         2.51              0.00           0.00  398.41    0.95  36428.00
ivf              70         2.76              0.00           0.00  362.32    0.96  41952.59
ivf              80         2.99              0.00           0.00  334.45    0.96  47599.64
ivf              90         3.31              0.00           0.00  302.11    0.96  53254.45
ivf             100         3.69              0.00           0.00  271.00    0.97  58917.00
```

This makes easier to plot the n_probe curve while doing changes.
2025-06-30 22:47:28 +10:00
Niels Bauman 5b9b0339ed
Fix typo in ILM retry action (#130255)
A change in #128930 introduced a typo which could result in erroneous
cluster state updates.
2025-06-30 08:55:49 -03:00
Yang Wang 6b0d53402c
Fix a racing condition in shard snapshot status update (#130302)
The enqueued task can run before the code reaches the status update
line. When it happens, the status update can set the status backwards.
This PR fixes it by moving the status update before enqueuing the task.

Resolves: #129752
2025-06-30 19:50:48 +10:00
Lisa Cawley fe75f8d6c6
[DOCS] Fix broken link in semantic-text.md (#130265)
This PR fixes an Asciidoc-style link that lingered in https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/semantic-text
2025-06-30 11:04:07 +02:00
Ievgen Degtiarenko 225f23cc01
Claim backported profile versions (#130187) 2025-06-30 09:42:59 +02:00
Martijn van Groningen 15c0028c04
Fix match_only_text bugs if defined as multi-field (#130188)
* Fix match_only_text bugs if defined as multi-field

Bugs starting to occur when #129126 was merged.

Closes #129737
2025-06-30 17:35:54 +10:00
elasticsearchmachine cbdafbac90 Mute org.elasticsearch.multiproject.test.CoreWithMultipleProjectsClientYamlTestSuiteIT test {yaml=cluster.stats/10_basic/Dense vector stats} #130307 2025-06-30 16:53:42 +10:00
Ignacio Vera 23cd462e07
Handle soar assignments when vector and centroid are very close (#130206) 2025-06-30 08:50:36 +02:00