Skip to content

Commit 0e8dcff

Browse files
committed
Merge remote-tracking branch 'carlosdelest/docs/esql-update-where-with-match-examples' into docs/esql-update-where-with-match-examples
2 parents 3381ea3 + 6d2f1e0 commit 0e8dcff

File tree

69 files changed

+2629
-391
lines changed

Some content is hidden

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

69 files changed

+2629
-391
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@
3131
import org.gradle.api.tasks.bundling.Jar;
3232
import org.gradle.api.tasks.javadoc.Javadoc;
3333
import org.gradle.external.javadoc.CoreJavadocOptions;
34+
import org.gradle.jvm.toolchain.JavaLanguageVersion;
35+
import org.gradle.jvm.toolchain.JavaToolchainService;
3436
import org.gradle.language.base.plugins.LifecycleBasePlugin;
3537

3638
import java.io.File;
3739
import java.util.Map;
3840

41+
import javax.inject.Inject;
42+
3943
import static org.elasticsearch.gradle.internal.conventions.util.Util.toStringable;
4044
import static org.elasticsearch.gradle.internal.util.ParamsUtils.loadBuildParams;
4145

@@ -44,6 +48,14 @@
4448
* common configuration for production code.
4549
*/
4650
public class ElasticsearchJavaPlugin implements Plugin<Project> {
51+
52+
private final JavaToolchainService javaToolchains;
53+
54+
@Inject
55+
ElasticsearchJavaPlugin(JavaToolchainService javaToolchains) {
56+
this.javaToolchains = javaToolchains;
57+
}
58+
4759
@Override
4860
public void apply(Project project) {
4961
project.getRootProject().getPlugins().apply(GlobalBuildInfoPlugin.class);
@@ -55,7 +67,7 @@ public void apply(Project project) {
5567
// configureConfigurations(project);
5668
configureJars(project, buildParams.get());
5769
configureJarManifest(project, buildParams.get());
58-
configureJavadoc(project);
70+
configureJavadoc(project, buildParams.get());
5971
testCompileOnlyDeps(project);
6072
}
6173

@@ -128,14 +140,18 @@ private static void configureJarManifest(Project project, BuildParameterExtensio
128140
project.getPluginManager().apply("nebula.info-jar");
129141
}
130142

131-
private static void configureJavadoc(Project project) {
143+
private void configureJavadoc(Project project, BuildParameterExtension buildParams) {
132144
project.getTasks().withType(Javadoc.class).configureEach(javadoc -> {
133145
/*
134146
* Generate docs using html5 to suppress a warning from `javadoc`
135147
* that the default will change to html5 in the future.
136148
*/
137149
CoreJavadocOptions javadocOptions = (CoreJavadocOptions) javadoc.getOptions();
138150
javadocOptions.addBooleanOption("html5", true);
151+
152+
javadoc.getJavadocTool().set(javaToolchains.javadocToolFor(spec -> {
153+
spec.getLanguageVersion().set(JavaLanguageVersion.of(buildParams.getMinimumRuntimeVersion().getMajorVersion()));
154+
}));
139155
});
140156

141157
TaskProvider<Javadoc> javadoc = project.getTasks().withType(Javadoc.class).named("javadoc");

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
import org.gradle.api.Plugin;
1818
import org.gradle.api.Project;
1919
import org.gradle.api.Task;
20+
import org.gradle.api.file.FileSystemOperations;
2021
import org.gradle.api.file.ProjectLayout;
2122
import org.gradle.api.model.ObjectFactory;
2223
import org.gradle.api.plugins.JvmToolchainsPlugin;
2324
import org.gradle.api.provider.Provider;
2425
import org.gradle.api.provider.ProviderFactory;
25-
import org.gradle.api.tasks.Copy;
2626
import org.gradle.api.tasks.PathSensitivity;
2727
import org.gradle.api.tasks.TaskProvider;
2828
import org.gradle.jvm.toolchain.JavaToolchainService;
@@ -54,11 +54,17 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
5454
private final ObjectFactory objectFactory;
5555
private ProviderFactory providerFactory;
5656
private JavaToolchainService toolChainService;
57+
private FileSystemOperations fileSystemOperations;
5758

5859
@Inject
59-
public InternalDistributionBwcSetupPlugin(ObjectFactory objectFactory, ProviderFactory providerFactory) {
60+
public InternalDistributionBwcSetupPlugin(
61+
ObjectFactory objectFactory,
62+
ProviderFactory providerFactory,
63+
FileSystemOperations fileSystemOperations
64+
) {
6065
this.objectFactory = objectFactory;
6166
this.providerFactory = providerFactory;
67+
this.fileSystemOperations = fileSystemOperations;
6268
}
6369

6470
@Override
@@ -76,7 +82,8 @@ public void apply(Project project) {
7682
providerFactory,
7783
objectFactory,
7884
toolChainService,
79-
isCi
85+
isCi,
86+
fileSystemOperations
8087
);
8188
});
8289
}
@@ -88,7 +95,8 @@ private static void configureBwcProject(
8895
ProviderFactory providerFactory,
8996
ObjectFactory objectFactory,
9097
JavaToolchainService toolChainService,
91-
Boolean isCi
98+
Boolean isCi,
99+
FileSystemOperations fileSystemOperations
92100
) {
93101
ProjectLayout layout = project.getLayout();
94102
Provider<BwcVersions.UnreleasedVersionInfo> versionInfoProvider = providerFactory.provider(() -> versionInfo);
@@ -120,11 +128,18 @@ private static void configureBwcProject(
120128
List<DistributionProject> distributionProjects = resolveArchiveProjects(checkoutDir.get(), bwcVersion.get());
121129

122130
// Setup gradle user home directory
123-
project.getTasks().register("setupGradleUserHome", Copy.class, copy -> {
124-
copy.into(project.getGradle().getGradleUserHomeDir().getAbsolutePath() + "-" + project.getName());
125-
copy.from(project.getGradle().getGradleUserHomeDir().getAbsolutePath(), copySpec -> {
126-
copySpec.include("gradle.properties");
127-
copySpec.include("init.d/*");
131+
// We don't use a normal `Copy` task here as snapshotting the entire gradle user home is very expensive. This task is cheap, so
132+
// up-to-date checking doesn't buy us much
133+
project.getTasks().register("setupGradleUserHome", task -> {
134+
task.doLast(t -> {
135+
fileSystemOperations.copy(copy -> {
136+
String gradleUserHome = project.getGradle().getGradleUserHomeDir().getAbsolutePath();
137+
copy.into(gradleUserHome + "-" + project.getName());
138+
copy.from(gradleUserHome, copySpec -> {
139+
copySpec.include("gradle.properties");
140+
copySpec.include("init.d/*");
141+
});
142+
});
128143
});
129144
});
130145

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/MrjarPlugin.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ public void apply(Project project) {
8686
configurePreviewFeatures(project, javaExtension.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME), 21);
8787
for (int javaVersion : mainVersions) {
8888
String mainSourceSetName = SourceSet.MAIN_SOURCE_SET_NAME + javaVersion;
89-
SourceSet mainSourceSet = addSourceSet(project, javaExtension, mainSourceSetName, mainSourceSets, javaVersion);
89+
SourceSet mainSourceSet = addSourceSet(project, javaExtension, mainSourceSetName, mainSourceSets, javaVersion, true);
9090
configureSourceSetInJar(project, mainSourceSet, javaVersion);
9191
addJar(project, mainSourceSet, javaVersion);
9292
mainSourceSets.add(mainSourceSetName);
9393
testSourceSets.add(mainSourceSetName);
9494

9595
String testSourceSetName = SourceSet.TEST_SOURCE_SET_NAME + javaVersion;
96-
SourceSet testSourceSet = addSourceSet(project, javaExtension, testSourceSetName, testSourceSets, javaVersion);
96+
SourceSet testSourceSet = addSourceSet(project, javaExtension, testSourceSetName, testSourceSets, javaVersion, false);
9797
testSourceSets.add(testSourceSetName);
9898
createTestTask(project, buildParams, testSourceSet, javaVersion, mainSourceSets);
9999
}
@@ -121,7 +121,8 @@ private SourceSet addSourceSet(
121121
JavaPluginExtension javaExtension,
122122
String sourceSetName,
123123
List<String> parentSourceSets,
124-
int javaVersion
124+
int javaVersion,
125+
boolean isMainSourceSet
125126
) {
126127
SourceSet sourceSet = javaExtension.getSourceSets().maybeCreate(sourceSetName);
127128
for (String parentSourceSetName : parentSourceSets) {
@@ -135,6 +136,13 @@ private SourceSet addSourceSet(
135136
CompileOptions compileOptions = compileTask.getOptions();
136137
compileOptions.getRelease().set(javaVersion);
137138
});
139+
if (isMainSourceSet) {
140+
project.getTasks().create(sourceSet.getJavadocTaskName(), Javadoc.class, javadocTask -> {
141+
javadocTask.getJavadocTool().set(javaToolchains.javadocToolFor(spec -> {
142+
spec.getLanguageVersion().set(JavaLanguageVersion.of(javaVersion));
143+
}));
144+
});
145+
}
138146
configurePreviewFeatures(project, sourceSet, javaVersion);
139147

140148
// Since we configure MRJAR sourcesets to allow preview apis, class signatures for those

distribution/src/config/jvm.options

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## should create one or more files in the jvm.options.d
1010
## directory containing your adjustments.
1111
##
12-
## See https://www.elastic.co/guide/en/elasticsearch/reference/@project.minor.version@/jvm-options.html
12+
## See https://www.elastic.co/guide/en/elasticsearch/reference/@project.minor.version@/advanced-configuration.html#set-jvm-options
1313
## for more information.
1414
##
1515
################################################################

docs/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach {
130130
setting 'xpack.security.enabled', 'true'
131131
setting 'xpack.security.authc.api_key.enabled', 'true'
132132
setting 'xpack.security.authc.token.enabled', 'true'
133-
// disable the ILM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
133+
// disable the ILM and SLM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
134134
setting 'indices.lifecycle.history_index_enabled', 'false'
135+
setting 'slm.history_index_enabled', 'false'
135136
setting 'xpack.license.self_generated.type', 'trial'
136137
setting 'xpack.security.authc.realms.file.file.order', '0'
137138
setting 'xpack.security.authc.realms.native.native.order', '1'

docs/changelog/118585.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pr: 118585
2+
summary: Add a generic `rescorer` retriever based on the search request's rescore
3+
functionality
4+
area: Ranking
5+
type: feature
6+
issues:
7+
- 118327
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
pr: 116944
1+
pr: 118825
22
summary: "Remove support for type, fields, `copy_to` and boost in metadata field definition"
33
area: Mapping
44
type: breaking
55
issues: []
66
breaking:
77
title: "Remove support for type, fields, copy_to and boost in metadata field definition"
88
area: Mapping
9-
details: The type, fields, copy_to and boost parameters are no longer supported in metadata field definition
9+
details: The type, fields, copy_to and boost parameters are no longer supported in metadata field definition starting with version 9.
1010
impact: Users providing type, fields, copy_to or boost as part of metadata field definition should remove them from their mappings.
1111
notable: false

docs/changelog/119007.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 119007
2+
summary: Block-writes cannot be added after read-only
3+
area: Data streams
4+
type: bug
5+
issues:
6+
- 119002

docs/reference/esql/esql-limitations.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ FROM books
139139
| WHERE MATCH(author, "Faulkner") OR author LIKE "Hemingway"
140140
----
141141

142-
but this one will succeed, as it uses full text functions on both OR clauses:
142+
However this query will succeed because it uses full text functions on both `OR` clauses:
143143

144144
[source,esql]
145145
----

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ include::{esql-specs}/match-function.csv-spec[tag=match-with-field]
7373
include::{esql-specs}/match-function.csv-spec[tag=match-with-field-result]
7474
|===
7575

76-
For a simplified syntax, you can use the <<esql-search-operators,match operator>> `:` instead of `MATCH`.
76+
[TIP]
77+
====
78+
You can also use the shorthand <<esql-search-operators,match operator>> `:` instead of `MATCH`.
79+
====
7780

7881
include::../functions/like.asciidoc[tag=body]
7982

0 commit comments

Comments
 (0)