Commit graph

86968 commits

Author SHA1 Message Date
Dan Kortschak
6fe7d1c91c Update docs/changelog/128540.yaml 2025-06-27 01:13:07 +09:30
Dan Kortschak
264c139285 give up 2025-06-06 09:51:45 +09:30
Dan Kortschak
b078fcd778 try to make the compiler happy 2025-06-06 09:51:45 +09:30
Dan Kortschak
0e9522c419 address pr comments 2025-06-06 09:51:45 +09:30
Joe Gallo
e736908d79 Silence some warnings from IntelliJ 2025-06-06 09:51:45 +09:30
Joe Gallo
e973d13610 Fix some errant whitespace 2025-06-06 09:51:45 +09:30
Dan Kortschak
04430e39fd Update docs/changelog/128540.yaml 2025-06-06 09:51:45 +09:30
Dan Kortschak
b249d02cbd add tests 2025-06-06 09:51:45 +09:30
Dan Kortschak
233fa93e90 try using STRING.convert in place of toString in INTEGER and LONG convert 2025-06-06 09:51:45 +09:30
Dan Kortschak
2657fc7897 remove unused var
This was introduced from testConvertDouble where it is also unused.
2025-06-06 09:51:45 +09:30
Dan Kortschak
46c40cd49c address pr comment 2025-06-06 09:51:45 +09:30
Dan Kortschak
745866c779 add tests 2025-06-06 09:51:45 +09:30
Dan Kortschak
9f16e97a69 Preserve integer-exact representation of numbers in convert processor to string
This differentiates floating point values that are within the range of
exact integer correspondence and renders them as integers rather than
using the default java toString method which formats floating point
values in E-notation when the absolute value is at least 1e6.
2025-06-06 09:51:44 +09:30
Bogdan Pintea
0f8178a2a3
ESQL: Forward port 8.19 RegexMatch serialization change version (#128979)
Fwd port ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY_8_19.

Related: #128919.
2025-06-06 02:02:24 +02:00
Simon Chase
ee716f11b9
transport: edit TransportConnectionListener for close exceptions (#129015)
The TransportConnectionListener interface has previously included the
Transport.Connection being closed and unregistered in its onNodeDisconnected
callback. This is not in use, and can be removed as it is also available in the
onConnectionClosed callback. It is being replaced with a Nullable exception that
caused the close. This is being used in pending work (ES-11448) to differentiate
network issues from node restarts.

Closes ES-12007
2025-06-05 15:20:08 -07:00
elasticsearchmachine
aceaf23130 Merge patch/serverless-fix into main 2025-06-05 19:27:54 +00:00
elasticsearchmachine
f18f4ee9d0 Mute org.elasticsearch.packaging.test.DockerTests test073RunEsAsDifferentUserAndGroupWithoutBindMounting #128996 2025-06-06 00:50:17 +10:00
Marci W
a0bfe61a83
Remove stale synthetic source preview note (#128981) 2025-06-05 09:31:25 -04:00
elasticsearchmachine
f9fe613157 Mute org.elasticsearch.xpack.ccr.index.engine.FollowingEngineTests testProcessOnceOnPrimary #128541 2025-06-05 22:27:31 +10:00
Ido Cohen
62624928d1
Align Cloud Security Index Privileges 2025-06-05 15:10:09 +03:00
Fang Xing
79e600a269
[ES|QL] Date nanos implicit casting in union types option #2 (#127797)
* implicit casting for union typed fields mixed with datetime and date_nanos
2025-06-05 08:08:01 -04:00
Ignacio Vera
6f27ac8b83
Use binarySearch over terms instead of automaton in termsQueries on Wildcard fields (#128920)
This commit adds a BinaryDvConfirmedTermsQuery to execute terms queries which uses binary search over terms instead of an automaton.
2025-06-05 12:55:44 +02:00
Niels Bauman
560f706801
Make ILM ClusterStateActionStep project-aware (#128880)
This is part of an iterative process to make ILM project-aware.
2025-06-05 06:11:00 -04:00
Niels Bauman
140200d367
Don't calculate auto-sharding for failure store (#128921)
Auto-sharding is not yet implemented for the failure store, so we want
to avoid running this computation. The result of the computation is
currently not used anywhere, but it's better to be on the safe side and
avoid the computation altogether.
2025-06-05 11:55:50 +02:00
Kostas Krikellas
2a322aedac
Unmute FollowingEngineTests:: testProcessOnceOnPrimary (#128955)
A fix was separately submitted.
2025-06-05 05:19:34 -04:00
Aurélien FOUCRET
0ec230b9a3
Disable DenseVectorFieldTypeIT on build release. (#128953) 2025-06-05 11:16:36 +02:00
Niels Bauman
bb4928631b
Refactor ILM ExecuteStepsUpdateTask (#128915)
This method was quite large with multiple nested ifs/loops, so it could
use some refactoring for readability.

The only change in behavior is that we now catch exceptions at a
slightly higher level. There are no other changes in behavior.
2025-06-05 10:58:19 +02:00
Pete Gillin
3721613fde
ES-10936 Include project ID in enrich cache key (#128908)
This prevents collisions in the enrich cache for different projects.

Collisions would be unlikely without this chance, since the key
includes the index name, and the index name includes a
millisecond-precision timestamp, so it would only happen if two
projects executed enrich policies with the same name at the same time,
or if one project manipulated the alias to match the timestamp of the
other project.

However, collisions would have serious consequences (allowing
read-across of data between projects). This change closes that gap.
2025-06-05 08:38:48 +01:00
Niels Bauman
2124ea9168
Use default project ID singleton in more places (#128881)
We can use the singleton when parsing JSON and persisted cluster state
as well.
2025-06-05 09:17:46 +02:00
elasticsearchmachine
526522f8cb Mute org.elasticsearch.xpack.inference.InferenceGetServicesIT testGetServicesWithCompletionTaskType #128952 2025-06-05 16:51:10 +10:00
Rene Groeschke
649b505731
[Build] Address further dockerhub feedback on default Dockerfile (#128686)
* [Build] Address further dockerhub feedback on default Dockerfile
* Bring back license folder
* Minor cleanup
* polishing
2025-06-05 08:02:37 +02:00
Aurélien FOUCRET
993090d5a7
[ES|QL] COMPLETION command - Inference Operator implementation (#127409) 2025-06-05 07:57:35 +02:00
Anirudh2112
cc5a2d86df
Inject an unfollow action before executing a downsample action in ILM (#128788)
When an index alias/data stream is replicated via CCR, the follower index needs to unfollow the leader index before executing actions that will remove the original index.
The downsample action is also an action that removes the original index so the expected behaviour is that ILM would automatically unfollow.

Co-authored-by: Niels Bauman <nielsbauman@gmail.com>
2025-06-05 07:53:12 +02:00
Graeme Mjehovich
64460dfdae
Fix unsupported privileges error message during role and API key crea… (#128858)
* Fix unsupported privileges error message during role and API key creation

* Update docs/changelog/128858.yaml

* [CI] Auto commit changes from spotless

* Update docs/changelog/128858.yaml

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-06-04 18:46:18 -04:00
Craig Taverner
b01d55218f
Support DATE_NANOS in LOOKUP JOIN (#127962)
We reported in https://github.com/elastic/elasticsearch/issues/127249, there is no support for DATE_NANOS in LOOKUP JOIN, even though DATETIME is supported. This PR attempts to fix that.

The way that date-time was supported in LOOKUP JOIN (and ENRICH) was by using the `DateFieldMapper.DateFieldType.rangeQuery` (hidden behind the `termQuery` function) which internally takes our long values, casts them to Object, renders them to a string, parses that string back into an Instant (with a bunch of fancy and unnecessary checks for date-math, etc.), and then converts that instant back into a long for the actual query. Parts of this complex process are precision aware (ie. differentiate between ms and ns dates), but not the whole process. Simply dividing the original longs by 1_000_000 before passing them in actually works, but obviously looses precision. And the only reason it works anyway is that the date parsing code will accept a string containing a simple number and interpret it as either ms since the epoch, or years if the number is short enough. This does not work for nano-second dates, and in fact is far from ideal for LOOKUP JOIN on dates which does not need to re-parse the values at all.

This complex loop only makes sense in the Query DSL, where we can get all kinds of interesting sources of range values, but seems quite crazy for LOOKUP JOIN where we will always provide the join key from a LongBlock (the backing store of the DATE_TIME DataType, and the DATE_NANOS too).

So what we do here for DateNanos is provide two new methods to `DateFieldType`:
* `equalityQuery(Long, ...)` to replace `termQuery(Object, ...)`
* `rangeQuery(Long, Long, ...)` to replace `rangeQuery(Object, Object, ...)`

This allows us to pass in already parsed `long` values, and entirely skip the conversion to strings and re-parsing logic. The new methods are based on the original methods, but considerably simplified due to the removal of the complex parsing logic. The reason for both `equalityQuery` and `rangeQuery` is that it mimics the pattern used by the old `termQuery` with delegated directly down to `rangeQuery`. In addition to this, we hope to support range matching in `LOOKUP JOIN` in the near future.
2025-06-04 23:25:39 +02:00
Ben Chaplin
234e7ed95a
Fix RemoteClusterSecurityRestIT by waiting for tasks to finish (#128777) 2025-06-04 16:11:48 -04:00
Mayya Sharipova
4880245f3e
Fix IndexSortUpgradeIT test (#128900)
Relates to PR #127968

Closes #128861, #128862, #128863
2025-06-05 05:02:03 +10:00
Jordan Powers
de40ac45d1
Move Text class to libs/xcontent (#128780)
This PR is a precursor to #126492.

It does three things:
1. Move org.elasticsearch.common.text.Text from :server to
   org.elasticsearch.xcontent.Text in :libs:x-content.
2. Refactor the Text class to use a new EncodedBytes record instead of
   the elasticsearch BytesReference.
3. Add the XContentString interface, with the Text class implementing
   that interface.

These changes were originally implemented in #127666 and #128316,
however they were reverted in #128484 due to problems caused by the
mutable nature of java ByteBuffers. This is resolved by instead using a
new immutable EncodedBytes record.
2025-06-04 11:22:03 -07:00
Jan-Kazlouski-elastic
767d53fefa
Add Mistral AI Chat Completion support to Inference Plugin (#128538)
* Add Mistral AI Chat Completion support to Inference Plugin

* Add changelog file

* Fix tests and typos

* Refactor Mistral chat completion integration and add tests

* Refactor Mistral error response handling and extract StreamingErrorResponse entity

* Add Mistral chat completion request and response tests

* Enhance error response documentation and clarify StreamingErrorResponse structure

* Refactor Mistral chat completion request handling and introduce skip stream options parameter

* Refactor MistralChatCompletionServiceSettings to include rateLimitSettings in equality checks

* Enhance MistralErrorResponse documentation with detailed error examples

* Add comment for Mistral-specific 422 validation error in OpenAiResponseHandler

* [CI] Auto commit changes from spotless

* Refactor OpenAiUnifiedChatCompletionRequestEntity to remove unused fields and streamline constructor

* Refactor UnifiedChatCompletionRequestEntity and UnifiedCompletionRequest to rename and update stream options parameter

* Refactor MistralChatCompletionRequestEntityTests to improve JSON assertion and remove unused imports

* Add unit tests for MistralUnifiedChatCompletionResponseHandler to validate error handling

* Add unit tests for MistralService

* Update expected service count in testGetServicesWithCompletionTaskType

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-06-04 13:43:33 -04:00
David Turner
3b217b19bd
Revert "Add extra logging to testChildrenTasksCancelledOnTimeout (#128888)"
This reverts commit 43a9e6fc59.
2025-06-04 18:35:55 +01:00
ViggoC
a90aa97cbf
ESQL: Un-skip testPartiallyPushableSort after fixing #114515 (#128522) 2025-06-04 18:44:30 +02:00
Kathleen DeRusso
eee423aaa0
[ES|QL] Add MATCH_PHRASE (#127661)
* Initial commit of match_phrase

* Add MatchPhraseQueryTests

* First pass at CSV specs

* Update docs/changelog/127661.yaml

* Refactor so MatchPhrase doesn't use all fulltext test cases, just text only

* Fix tests

* Add some CSV test cases

* Fix test

* Update changelog

* Update tests

* Comment out MATCH_PHRASE in search-functions Markdown

* Minor PR feedback

* PR feedback - refactor/consolidate code

* Add some more tests

* Fix some tests

* [CI] Auto commit changes from spotless

* Fix tests

* PR feedback - add tests, support boost and numeric data

* Revert "PR feedback - add tests, support boost and numeric data"

This reverts commit 4e7a699e3e.

* Apply testing/PR feedback outside numeric support only

* Regenerate docs

* Add negative test

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>

* PR feedback

* Fix auto-commit error

* Regenerate docs

* Update x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchPhrase.java

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

* Remove non text field types

* Fake test data

* Remove tests that no longer should pass without ip/date/version support

* Put real data in score tests now that I was able to engineer a failure

* Realized the scoring test might be flakey because how it was written, updated

* PR feedback

* PR feedback

* [CI] Auto commit changes from spotless

* Add check to MatchPhrase tests

* Fix merge errors

* [CI] Auto commit changes from spotless

* Test generated docs

* Add additional verifier tests

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-06-04 12:32:24 -04:00
mbivert-ipsos
aa0a829a08
[DOCS] Fix missing spaces (#128550) 2025-06-04 18:59:42 +03:00
Ioana Tagirta
ca904ce05d
ES|QL: Fix ProjectAwayColumns for FORK (#128839) 2025-06-04 17:50:01 +02:00
David Turner
43a9e6fc59
Add extra logging to testChildrenTasksCancelledOnTimeout (#128888)
Relates #123568
2025-06-04 16:11:41 +01:00
Martijn van Groningen
e23a5e7661
Enable security in a number of logsdb and tsdb integration tests. (#128877)
This change enables security in a number of tsdb and logsdb integration tests. A number of java/yaml rest tests in logsdb module, additionally logsdb and tsdb rolling upgrade tests.

A recent bug (#128050) wouldn't have happened if logsdb rolling upgrade tests ran with security enabled.
2025-06-04 17:23:25 +03:00
Panagiotis Bailis
213132392d
Updating score assertions on linear retriever yml tests to use close_to instead of match (#128865) 2025-06-04 17:16:44 +03:00
Niels Bauman
04848b1b85
Claim transport version for backporting ILM skip setting (#128876)
Preparation for backporting #128736.
2025-06-04 15:36:28 +02:00
Samiul Monir
d1b5532dbf
Semantic_text match_all with Highlighter (#128702)
* initial implementation for match_All

* reformat

* [CI] Auto commit changes from spotless

* Excluding matchAllintercepter

* Adding matchAllDocs support for vector fields

* [CI] Auto commit changes from spotless

* Remove previous implementation

* Adding yaml tests for match_all

* fixed yaml tests

* Update docs/changelog/128702.yaml

* Update changelog

* changelog - update summary

* Fix wrong inference names for the yaml tests

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-06-04 09:33:25 -04:00
Luigi Dell'Aquila
8db3ee43ff
ES|QL: Split JOIN yaml tests so that non-alias queries run also on bwc (#128884) 2025-06-04 15:22:47 +02:00