Skip to content

Commit f57270a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into inference_metadata_fields
2 parents fa77a51 + 3ab612f commit f57270a

File tree

180 files changed

+2938
-832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+2938
-832
lines changed

build-tools-internal/src/main/groovy/elasticsearch.ide.gradle

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ allprojects {
2424
}
2525
}
2626

27+
interface Injected {
28+
@Inject FileSystemOperations getFs()
29+
}
30+
2731
// Applying this stuff, particularly the idea-ext plugin, has a cost so avoid it unless we're running in the IDE
2832
if (providers.systemProperty('idea.active').getOrNull() == 'true') {
2933
project.apply(plugin: org.jetbrains.gradle.ext.IdeaExtPlugin)
3034

3135
def elasticsearchProject = locateElasticsearchWorkspace(gradle)
3236

37+
def rootFolder = project.rootDir
3338
tasks.register('configureIdeCheckstyle') {
3439
group = 'ide'
3540
description = 'Generated a suitable checkstyle config for IDEs'
@@ -39,10 +44,10 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
3944
String checkstyleConfig = "${resources}/checkstyle.xml"
4045
String checkstyleSuppressions = "${resources}/checkstyle_suppressions.xml"
4146
String checkstyleIdeFragment = "${resources}/checkstyle_ide_fragment.xml"
42-
String checkstyleIdeConfig = "${rootDir}/checkstyle_ide.xml"
47+
String checkstyleIdeConfig = "${rootFolder}/checkstyle_ide.xml"
4348

4449
String checkstylePluginConfigTemplate = "${resources}/checkstyle-idea.xml"
45-
String checkstylePluginConfig = "${rootDir}/.idea/checkstyle-idea.xml"
50+
String checkstylePluginConfig = "${rootFolder}/.idea/checkstyle-idea.xml"
4651

4752
inputs.files(
4853
file(checkstyleConfig),
@@ -53,31 +58,33 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
5358
file(checkstyleIdeConfig),
5459
file(checkstylePluginConfig)
5560
)
61+
def injected = project.objects.newInstance(Injected)
5662

63+
def projectFolder = project.layout.projectDirectory.asFile
5764
doLast {
5865
// Configure the IntelliJ Checkstyle plugin by copying a standard file. We don't simply commit
5966
// the result to version control, because the plugin has a habit of modifying the file and
6067
// replacing the `$PROJECT_DIR$` placeholders, which developers must then revert.
61-
project.copy {
68+
injected.fs.copy {
6269
from(checkstylePluginConfigTemplate)
63-
into("${rootDir}/.idea")
70+
into("${rootFolder}/.idea")
6471
expand(jarLocation: buildConventionsJar, configLocation: checkstyleIdeConfig)
6572
}
6673

6774
// Create an IDE-specific checkstyle config by first copying the standard config
6875
Files.copy(
69-
Paths.get(file(checkstyleConfig).getPath()),
70-
Paths.get(file(checkstyleIdeConfig).getPath()),
76+
Paths.get(new File(checkstyleConfig).getPath()),
77+
Paths.get(new File(checkstyleIdeConfig).getPath()),
7178
StandardCopyOption.REPLACE_EXISTING
7279
)
7380

7481
// There are some rules that we only want to enable in an IDE. These
7582
// are extracted to a separate file, and merged into the IDE-specific
7683
// Checkstyle config.
77-
Node xmlFragment = parseXml(checkstyleIdeFragment)
84+
Node xmlFragment = IdeaXmlUtil.parseXml(checkstyleIdeFragment)
7885

7986
// Edit the copy so that IntelliJ can copy with it
80-
modifyXml(checkstyleIdeConfig, { xml ->
87+
IdeaXmlUtil.modifyXml(checkstyleIdeConfig, { xml ->
8188
// Add all the nodes from the fragment file
8289
Node treeWalker = xml.module.find { it.'@name' == 'TreeWalker' }
8390
xmlFragment.module.each { treeWalker.append(it) }
@@ -103,7 +110,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
103110
description = 'Configures the appropriate JVM for Gradle'
104111

105112
doLast {
106-
modifyXml('.idea/gradle.xml') { xml ->
113+
IdeaXmlUtil.modifyXml('.idea/gradle.xml') { xml ->
107114
def gradleSettings = xml.component.find { it.'@name' == 'GradleSettings' }.option[0].GradleProjectSettings
108115
// Remove configured JVM option to force IntelliJ to use the project JDK for Gradle
109116
gradleSettings.option.findAll { it.'@name' == 'gradleJvm' }.each { it.parent().remove(it) }
@@ -127,7 +134,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
127134
description = 'Enable per-module *.iml files'
128135

129136
doLast {
130-
modifyXml('.idea/misc.xml') {xml ->
137+
IdeaXmlUtil.modifyXml('.idea/misc.xml') {xml ->
131138
def externalStorageConfig = xml.component.find { it.'@name' == 'ExternalStorageConfigurationManager' }
132139
if (externalStorageConfig) {
133140
xml.remove(externalStorageConfig)
@@ -142,13 +149,13 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
142149
description = 'Enables preview features on native library module'
143150
dependsOn tasks.named("enableExternalConfiguration")
144151

145-
ext {
146-
enablePreview = { moduleFile, languageLevel ->
147-
modifyXml(moduleFile) { xml ->
152+
// ext {
153+
def enablePreview = { moduleFile, languageLevel ->
154+
IdeaXmlUtil.modifyXml(moduleFile) { xml ->
148155
xml.component.find { it.'@name' == 'NewModuleRootManager' }?.'@LANGUAGE_LEVEL' = languageLevel
149156
}
150157
}
151-
}
158+
// }
152159

153160
doLast {
154161
enablePreview('.idea/modules/libs/native/elasticsearch.libs.native.main.iml', 'JDK_21_PREVIEW')
@@ -278,33 +285,37 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
278285
* @param preface optional front matter to add after the XML declaration
279286
* but before the XML document, e.g. a doctype or comment
280287
*/
281-
void modifyXml(Object path, Action<? super Node> action, String preface = null) {
282-
if (project.file(path).exists()) {
283-
Node xml = parseXml(path)
284-
action.execute(xml)
285-
286-
File xmlFile = project.file(path)
287-
xmlFile.withPrintWriter { writer ->
288-
def printer = new XmlNodePrinter(writer)
289-
printer.namespaceAware = true
290-
printer.preserveWhitespace = true
291-
writer.write("<?xml version=\"1.0\"?>\n")
292-
293-
if (preface != null) {
294-
writer.write(preface)
288+
289+
class IdeaXmlUtil {
290+
static Node parseXml(Object xmlPath) {
291+
File xmlFile = new File(xmlPath)
292+
XmlParser xmlParser = new XmlParser(false, true, true)
293+
xmlParser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
294+
Node xml = xmlParser.parse(xmlFile)
295+
return xml
296+
}
297+
298+
static void modifyXml(Object xmlPath, Action<? super Node> action, String preface = null) {
299+
File xmlFile = new File(xmlPath)
300+
if (xmlFile.exists()) {
301+
Node xml = parseXml(xmlPath)
302+
action.execute(xml)
303+
304+
xmlFile.withPrintWriter { writer ->
305+
def printer = new XmlNodePrinter(writer)
306+
printer.namespaceAware = true
307+
printer.preserveWhitespace = true
308+
writer.write("<?xml version=\"1.0\"?>\n")
309+
310+
if (preface != null) {
311+
writer.write(preface)
312+
}
313+
printer.print(xml)
295314
}
296-
printer.print(xml)
297315
}
298316
}
299317
}
300318

301-
Node parseXml(Object path) {
302-
File xmlFile = project.file(path)
303-
XmlParser xmlParser = new XmlParser(false, true, true)
304-
xmlParser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
305-
Node xml = xmlParser.parse(xmlFile)
306-
return xml
307-
}
308319

309320
Pair<File, IncludedBuild> locateElasticsearchWorkspace(Gradle gradle) {
310321
if (gradle.parent == null) {

distribution/docker/src/docker/iron_bank/hardening_manifest.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
---
22
apiVersion: v1
3-
43
# The repository name in registry1, excluding /ironbank/
54
name: "elastic/elasticsearch/elasticsearch"
6-
75
# List of tags to push for the repository in registry1
86
# The most specific version should be the first tag and will be shown
97
# on ironbank.dsop.io
108
tags:
119
- "${version}"
1210
- "latest"
13-
1411
# Build args passed to Dockerfile ARGs
1512
args:
1613
BASE_IMAGE: "redhat/ubi/ubi9"
17-
BASE_TAG: "9.4"
18-
14+
BASE_TAG: "9.5"
1915
# Docker image labels
2016
labels:
2117
org.opencontainers.image.title: "elasticsearch"
@@ -34,7 +30,6 @@ labels:
3430
mil.dso.ironbank.image.type: "commercial"
3531
# Product the image belongs to for grouping multiple images
3632
mil.dso.ironbank.product.name: "elasticsearch"
37-
3833
# List of resources to make available to the offline build context
3934
resources:
4035
- filename: "elasticsearch-${version}-linux-x86_64.tar.gz"
@@ -47,7 +42,6 @@ resources:
4742
validation:
4843
type: "sha256"
4944
value: "93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c"
50-
5145
# List of project maintainers
5246
maintainers:
5347
- name: "Mark Vieira"

docs/changelog/118603.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 118603
2+
summary: Allow DATE_PARSE to read the timezones
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 117680

docs/reference/esql/esql-limitations.asciidoc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ it is necessary to use the search function, like <<esql-match>>, in a <<esql-whe
112112
directly after the <<esql-from>> source command, or close enough to it.
113113
Otherwise, the query will fail with a validation error.
114114
Another limitation is that any <<esql-where>> command containing a full-text search function
115-
cannot also use disjunctions (`OR`).
115+
cannot also use disjunctions (`OR`) unless all functions used in the OR clauses are full-text functions themselves.
116116

117117
For example, this query is valid:
118118

@@ -139,6 +139,15 @@ FROM books
139139
| WHERE MATCH(author, "Faulkner") OR author LIKE "Hemingway"
140140
----
141141

142+
However this query will succeed because it uses full text functions on both `OR` clauses:
143+
144+
[source,esql]
145+
----
146+
FROM books
147+
| WHERE MATCH(author, "Faulkner") OR QSTR("author: Hemingway")
148+
----
149+
150+
142151
Note that, because of <<esql-limitations-text-fields,the way {esql} treats `text` values>>,
143152
any queries on `text` fields that do not explicitly use the full-text functions,
144153
<<esql-match>> or <<esql-qstr>>, will behave as if the fields are actually `keyword` fields:

docs/reference/esql/functions/description/match.asciidoc

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/kibana/definition/match.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/kibana/docs/match.md

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/search-functions.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
++++
77

88
Full text functions are used to search for text in fields.
9-
<<analysis, Text analysiss>> is used to analyze the query before it is searched.
9+
<<analysis, Text analysis>> is used to analyze the query before it is searched.
1010

1111
Full text functions can be used to match <<esql-multivalued-fields,multivalued fields>>.
1212
A multivalued field that contains a value that matches a full text query is considered to match the query.
1313

14+
Full text functions are significantly more performant for text search use cases on large data sets than using pattern matching or regular expressions with `LIKE` or `RLIKE`
15+
1416
See <<esql-limitations-full-text-search,full text search limitations>> for information on the limitations of full text search.
1517

1618
{esql} supports these full-text search functions:

docs/reference/esql/processing-commands/where.asciidoc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ the input table for which the provided condition evaluates to `true`.
77

88
[TIP]
99
====
10-
In case of value exclusions, fields with `null` values will be excluded from search results.
10+
In case of value exclusions, fields with `null` values will be excluded from search results.
1111
In this context a `null` means either there is an explicit `null` value in the document or there is no value at all.
1212
For example: `WHERE field != "value"` will be interpreted as `WHERE field != "value" AND field IS NOT NULL`.
1313
====
@@ -58,6 +58,26 @@ For a complete list of all functions, refer to <<esql-functions>>.
5858

5959
include::../functions/predicates.asciidoc[tag=body]
6060

61+
For matching text, you can use <<esql-search-functions,full text search functions>> like `MATCH`.
62+
63+
Use <<esql-match,`MATCH`>> to perform a <<query-dsl-match-query,match query>> on a specified field.
64+
65+
Match can be used on text fields, as well as other field types like boolean, dates, and numeric types.
66+
67+
[source.merge.styled,esql]
68+
----
69+
include::{esql-specs}/match-function.csv-spec[tag=match-with-field]
70+
----
71+
[%header.monospaced.styled,format=dsv,separator=|]
72+
|===
73+
include::{esql-specs}/match-function.csv-spec[tag=match-with-field-result]
74+
|===
75+
76+
[TIP]
77+
====
78+
You can also use the shorthand <<esql-search-operators,match operator>> `:` instead of `MATCH`.
79+
====
80+
6181
include::../functions/like.asciidoc[tag=body]
6282

6383
include::../functions/rlike.asciidoc[tag=body]

docs/reference/indices/shard-stores.asciidoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,8 @@ The API returns the following response:
172172
"attributes": {},
173173
"roles": [...],
174174
"version": "8.10.0",
175-
"min_index_version": 8000099,
176-
"min_read_only_index_version": 7000099,
177-
"max_index_version": 9004000
175+
"min_index_version": 7000099,
176+
"max_index_version": 8100099
178177
},
179178
"allocation_id": "2iNySv_OQVePRX-yaRH_lQ", <4>
180179
"allocation" : "primary|replica|unused" <5>
@@ -194,7 +193,6 @@ The API returns the following response:
194193
// TESTRESPONSE[s/"roles": \[[^]]*\]/"roles": $body.$_path/]
195194
// TESTRESPONSE[s/"8.10.0"/\$node_version/]
196195
// TESTRESPONSE[s/"min_index_version": 7000099/"min_index_version": $body.$_path/]
197-
// TESTRESPONSE[s/"min_index_version": 7000099/"min_index_version": $body.$_path/]
198196
// TESTRESPONSE[s/"max_index_version": 8100099/"max_index_version": $body.$_path/]
199197

200198

0 commit comments

Comments
 (0)