Skip to content

Commit

Permalink
Merge branch '8.x' into backport/8.x/pr-120291
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest authored Jan 28, 2025
2 parents f690656 + ff4f9d7 commit 3539843
Show file tree
Hide file tree
Showing 83 changed files with 1,599 additions and 322 deletions.
27 changes: 19 additions & 8 deletions .buildkite/pipelines/pull-request/release-tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
config:
allow-labels: test-release
steps:
- label: release-tests
command: .buildkite/scripts/release-tests.sh
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
diskSizeGb: 350
machineType: custom-32-98304
- group: release-tests
steps:
- label: "{{matrix.CHECK_TASK}} / release-tests"
key: "packaging-tests-unix"
command: .buildkite/scripts/release-tests.sh {{matrix.CHECK_TASK}}
timeout_in_minutes: 120
matrix:
setup:
CHECK_TASK:
- checkPart1
- checkPart2
- checkPart3
- checkPart4
- checkPart5
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
diskSizeGb: 350
machineType: custom-32-98304
2 changes: 1 addition & 1 deletion .buildkite/scripts/release-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ curl --fail -o "${ML_IVY_REPO}/maven/org/elasticsearch/ml/ml-cpp/${ES_VERSION}/m
curl --fail -o "${ML_IVY_REPO}/maven/org/elasticsearch/ml/ml-cpp/${ES_VERSION}/ml-cpp-${ES_VERSION}.zip" https://artifacts-snapshot.elastic.co/ml-cpp/${ES_VERSION}-SNAPSHOT/downloads/ml-cpp/ml-cpp-${ES_VERSION}-SNAPSHOT.zip

.ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dbuild.snapshot=false -Dbuild.ml_cpp.repo=file://${ML_IVY_REPO} \
-Dtests.jvm.argline=-Dbuild.snapshot=false -Dlicense.key=${WORKSPACE}/x-pack/license-tools/src/test/resources/public.key -Dbuild.id=deadbeef assemble functionalTests
-Dtests.jvm.argline=-Dbuild.snapshot=false -Dlicense.key=${WORKSPACE}/x-pack/license-tools/src/test/resources/public.key -Dbuild.id=deadbeef ${@:-functionalTests}
51 changes: 43 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -296,22 +296,57 @@ allprojects {
}
}

ext.withReleaseBuild = { Closure config ->
if(buildParams.snapshotBuild == false) {
config.call()
}
}

plugins.withId('lifecycle-base') {
if (project.path.startsWith(":x-pack:")) {
if (project.path.contains("security") || project.path.contains(":ml")) {
tasks.register('checkPart4') { dependsOn 'check' }
} else if (project.path == ":x-pack:plugin" || project.path.contains("ql") || project.path.contains("smoke-test")) {
tasks.register('checkPart3') { dependsOn 'check' }
tasks.register('checkPart4') {
dependsOn 'check'
withReleaseBuild {
dependsOn 'assemble'
}
}
} else if (project.path == ":x-pack:plugin" || project.path.contains("ql") || project.path.contains("smoke-test")) {
tasks.register('checkPart3') {
dependsOn 'check'
withReleaseBuild {
dependsOn 'assemble'
}
}
} else if (project.path.contains("multi-node")) {
tasks.register('checkPart5') { dependsOn 'check' }
tasks.register('checkPart5') {
dependsOn 'check'
withReleaseBuild {
dependsOn 'assemble'
}
}
} else {
tasks.register('checkPart2') { dependsOn 'check' }
tasks.register('checkPart2') {
dependsOn 'check'
withReleaseBuild {
dependsOn 'assemble'
}
}
}
} else {
tasks.register('checkPart1') { dependsOn 'check' }
tasks.register('checkPart1') {
dependsOn 'check'
withReleaseBuild {
dependsOn 'assemble'
}
}
}
tasks.register('functionalTests') {
dependsOn 'check'
withReleaseBuild {
dependsOn 'assemble'
}
}

tasks.register('functionalTests') { dependsOn 'check' }
}

/*
Expand Down
19 changes: 9 additions & 10 deletions docs/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,15 @@ used for its modifiers:
* `// TESTRESPONSE[skip:reason]`: Skip the assertions specified by this
response.
* `// TESTSETUP`: Marks this snippet as the "setup" for all other snippets in
this file. This is a somewhat natural way of structuring documentation. You
say "this is the data we use to explain this feature" then you add the
snippet that you mark `// TESTSETUP` and then every snippet will turn into
a test that runs the setup snippet first. See the "painless" docs for a file
that puts this to good use. This is fairly similar to `// TEST[setup:name]`
but rather than the setup defined in `docs/build.gradle` the setup is defined
right in the documentation file. In general, we should prefer `// TESTSETUP`
over `// TEST[setup:name]` because it makes it more clear what steps have to
be taken before the examples will work. Tip: `// TESTSETUP` can only be used
on the first snippet of a document.
this file. In order to enhance clarity and simplify understanding for readers,
a straightforward approach involves marking the first snippet in the documentation file with the
`// TESTSETUP` marker. By doing so, it clearly indicates that this particular snippet serves as the setup
or preparation step for all subsequent snippets in the file.
This helps in explaining the necessary steps that need to be executed before running the examples.
Unlike the alternative convention `// TEST[setup:name]`, which relies on a setup defined in a separate file,
this convention brings the setup directly into the documentation file, making it more self-contained and reducing ambiguity.
By adopting this convention, users can easily identify and follow the correct sequence
of steps to ensure that the examples provided in the documentation work as intended.
* `// TEARDOWN`: Ends and cleans up a test series started with `// TESTSETUP` or
`// TEST[setup:name]`. You can use `// TEARDOWN` to set up multiple tests in
the same file.
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog/120483.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 120483
summary: Fix NPE on disabled API auth key cache
area: Authentication
type: bug
issues: []
7 changes: 7 additions & 0 deletions docs/changelog/120725.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pr: 120725
summary: |-
A new query parameter `?include_source_on_error` was added for create / index, update and bulk REST APIs to control
if to include the document source in the error response in case of parsing errors. The default value is `true`.
area: Infra/REST API
type: enhancement
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/120727.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 120727
summary: Esql - Support date nanos in date extract function
area: ES|QL
type: enhancement
issues:
- 110000
36 changes: 36 additions & 0 deletions docs/reference/esql/functions/kibana/definition/date_extract.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/reference/esql/functions/types/date_extract.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 36 additions & 2 deletions docs/reference/query-dsl/match-phrase-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,45 @@ GET /_search
}
--------------------------------------------------

[[match-phrase-field-params]]
==== Parameters for `<field>`
`query`::
+
--
(Required) Text, number, boolean value or date you wish to find in the provided
`<field>`.
--

`analyzer`::
(Optional, string) <<analysis,Analyzer>> used to convert the text in the `query`
value into tokens. Defaults to the <<specify-index-time-analyzer,index-time
analyzer>> mapped for the `<field>`. If no analyzer is mapped, the index's
default analyzer is used.

`slop`::
(Optional, integer) Maximum number of positions allowed between matching tokens.
Defaults to `0`. Transposed terms have a slop of `2`.

`zero_terms_query`::
+
--
(Optional, string) Indicates whether no documents are returned if the `analyzer`
removes all tokens, such as when using a `stop` filter. Valid values are:

`none` (Default)::
No documents are returned if the `analyzer` removes all tokens.

`all`::
Returns all documents, similar to a <<query-dsl-match-all-query,`match_all`>>
query.
--

A phrase query matches terms up to a configurable `slop`
(which defaults to 0) in any order. Transposed terms have a slop of 2.

[[query-dsl-match-query-phrase-analyzer]]
===== Analyzer in the match phrase query

The `analyzer` can be set to control which analyzer will perform the
analysis process on the text. It defaults to the field explicit mapping
definition, or the default search analyzer, for example:
Expand All @@ -40,5 +76,3 @@ GET /_search
}
}
--------------------------------------------------

This query also accepts `zero_terms_query`, as explained in <<query-dsl-match-query, `match` query>>.
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,35 @@ The following example adds `my_analyzer` as a search analyzer to the `title` fie

[source,JSON]
----
{
"mappings": {
"properties": {
"title": {
"type": "text",
"search_analyzer": "my_analyzer",
"updateable": true
"search_analyzer": "my_analyzer"
}
}
},
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "whitespace",
"filter": [
"synonyms_filter"
]
}
},
"filter": {
"synonyms_filter": {
"type": "synonym",
"synonyms_path": "analysis/synonym-set.txt",
"updateable": true
}
}
}
}
}
----


Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public class XContentParserConfigurationImpl implements XContentParserConfigurat
RestApiVersion.current(),
null,
null,
false
false,
true
);

final NamedXContentRegistry registry;
Expand All @@ -40,21 +41,45 @@ public class XContentParserConfigurationImpl implements XContentParserConfigurat
final FilterPath[] includes;
final FilterPath[] excludes;
final boolean filtersMatchFieldNamesWithDots;
final boolean includeSourceOnError;

private XContentParserConfigurationImpl(
NamedXContentRegistry registry,
DeprecationHandler deprecationHandler,
RestApiVersion restApiVersion,
FilterPath[] includes,
FilterPath[] excludes,
boolean filtersMatchFieldNamesWithDots
boolean filtersMatchFieldNamesWithDots,
boolean includeSourceOnError
) {
this.registry = registry;
this.deprecationHandler = deprecationHandler;
this.restApiVersion = restApiVersion;
this.includes = includes;
this.excludes = excludes;
this.filtersMatchFieldNamesWithDots = filtersMatchFieldNamesWithDots;
this.includeSourceOnError = includeSourceOnError;
}

@Override
public boolean includeSourceOnError() {
return includeSourceOnError;
}

@Override
public XContentParserConfiguration withIncludeSourceOnError(boolean includeSourceOnError) {
if (includeSourceOnError == this.includeSourceOnError) {
return this;
}
return new XContentParserConfigurationImpl(
registry,
deprecationHandler,
restApiVersion,
includes,
excludes,
filtersMatchFieldNamesWithDots,
includeSourceOnError
);
}

@Override
Expand All @@ -65,7 +90,8 @@ public XContentParserConfigurationImpl withRegistry(NamedXContentRegistry regist
restApiVersion,
includes,
excludes,
filtersMatchFieldNamesWithDots
filtersMatchFieldNamesWithDots,
includeSourceOnError
);
}

Expand All @@ -80,7 +106,8 @@ public XContentParserConfiguration withDeprecationHandler(DeprecationHandler dep
restApiVersion,
includes,
excludes,
filtersMatchFieldNamesWithDots
filtersMatchFieldNamesWithDots,
includeSourceOnError
);
}

Expand All @@ -95,7 +122,8 @@ public XContentParserConfiguration withRestApiVersion(RestApiVersion restApiVers
restApiVersion,
includes,
excludes,
filtersMatchFieldNamesWithDots
filtersMatchFieldNamesWithDots,
includeSourceOnError
);
}

Expand Down Expand Up @@ -143,7 +171,8 @@ public XContentParserConfiguration withFiltering(
restApiVersion,
includePaths,
excludePaths,
filtersMatchFieldNamesWithDots
filtersMatchFieldNamesWithDots,
includeSourceOnError
);
}

Expand Down
Loading

0 comments on commit 3539843

Please sign in to comment.