Skip to content

Commit e43f018

Browse files
authored
Merge branch 'main' into multi-project/x-pack/metadata
2 parents 313c028 + 2fa6651 commit e43f018

File tree

191 files changed

+1623
-1483
lines changed

Some content is hidden

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

191 files changed

+1623
-1483
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def generateUpgradeCompatibilityFile = tasks.register("generateUpgradeCompatibil
241241
}
242242

243243
def upgradeCompatibilityZip = tasks.register("upgradeCompatibilityZip", Zip) {
244-
archiveFile.set(project.layout.buildDirectory.file("rolling-upgrade-compatible-${VersionProperties.elasticsearch}.zip"))
244+
archiveFile.set(project.layout.buildDirectory.file("distributions/rolling-upgrade-compatible-${VersionProperties.elasticsearch}.zip"))
245245
from(generateUpgradeCompatibilityFile)
246246
}
247247

docs/changelog/122615.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pr: 122615
2+
summary: Enable synthetic recovery source by default when synthetic source is enabled.
3+
Using synthetic recovery source significantly improves indexing performance compared
4+
to regular recovery source.
5+
area: Mapping
6+
type: enhancement
7+
issues:
8+
- 116726

docs/changelog/123743.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 123743
2+
summary: Adjust exception thrown when unable to load hunspell dict
3+
area: Analysis
4+
type: bug
5+
issues: []

docs/changelog/124001.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pr: 124001
2+
summary: Use a must boolean statement when pushing down to Lucene when scoring is
3+
also needed
4+
area: ES|QL
5+
type: bug
6+
issues:
7+
- 123967

docs/changelog/124050.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 124050
2+
summary: Use `FallbackSyntheticSourceBlockLoader` for boolean and date fields
3+
area: Mapping
4+
type: enhancement
5+
issues: []

docs/reference/elasticsearch/configuration-reference/node-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The following additional roles are available:
4646

4747
* `voting_only`
4848

49-
$$$coordinating-only-node$$$If you leave `node.roles` unset, then the node is considered to be a [coordinating only node](docs-content://deploy-manage/distributed-architecture/clusters-nodes-shards/node-roles.md#coordinating-only-node-role).
49+
$$$coordinating-only-node$$$If If you set `node.roles` to an empty array (`node.roles: [ ]`), then the node is considered to be a [coordinating only node](docs-content://deploy-manage/distributed-architecture/clusters-nodes-shards/node-roles.md#coordinating-only-node-role).
5050

5151
::::{important}
5252
If you set `node.roles`, ensure you specify every node role your cluster needs. Every cluster requires the following node roles:

docs/reference/ingestion-tools/search-connectors/es-connectors-servicenow.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,12 @@ The ServiceNow connector supports roles for access control lists (ACLs) to enabl
205205

206206
For services other than these defaults, the connector iterates over access controls with `read` operations and finds the respective roles for those services.
207207

208+
:::{important}
209+
The ServiceNow connector applies access control at the service (table) level. This means documents within a given ServiceNow table share the same access control settings. Users with permission to a table can access all documents from that table in Elasticsearch.
210+
:::
211+
208212
::::{note}
209213
The ServiceNow connector does not support scripted and conditional permissions.
210-
211214
::::
212215

213216

modules/analysis-common/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* your election, the "Elastic License 2.0", the "GNU Affero General Public
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
9-
import org.elasticsearch.gradle.Version
10-
119
apply plugin: 'elasticsearch.internal-yaml-rest-test'
1210
apply plugin: 'elasticsearch.yaml-rest-compat-test'
1311
apply plugin: 'elasticsearch.internal-cluster-test'
@@ -36,6 +34,7 @@ artifacts {
3634

3735
tasks.named("yamlRestCompatTestTransform").configure { task ->
3836
task.replaceValueInMatch("tokens.0.token", "absenț", "romanian")
37+
task.skipTest("indices.analyze/15_analyze/Custom analyzer is not buildable", "error response changed with #123743")
3938
}
4039

4140
tasks.named("yamlRestTest").configure {

modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/15_analyze.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@
6464
"Custom analyzer is not buildable":
6565
- requires:
6666
test_runner_features: [ capabilities ]
67-
reason: This capability required to run test
6867
capabilities:
69-
- method: GET
70-
path: /_analyze
71-
capabilities: [ wrong_custom_analyzer_returns_400 ]
68+
- method: PUT
69+
path: /{index}
70+
capabilities: [ hunspell_dict_400 ]
71+
reason: "bugfix 'hunspell_dict_400' capability required"
7272

7373
- do:
7474
catch: bad_request
@@ -80,7 +80,3 @@
8080
filter:
8181
type: hunspell
8282
locale: en_US
83-
84-
- match: { status: 400 }
85-
- match: { error.type: illegal_argument_exception }
86-
- match: { error.reason: "Can not build a custom analyzer" }

modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/RegisteredDomainProcessorTests.java

Lines changed: 75 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -13,52 +13,45 @@
1313
import org.elasticsearch.ingest.TestIngestDocument;
1414
import org.elasticsearch.test.ESTestCase;
1515

16+
import java.util.Collections;
1617
import java.util.Map;
1718

18-
import static org.hamcrest.Matchers.containsString;
19-
import static org.hamcrest.Matchers.equalTo;
19+
import static java.util.Map.entry;
20+
import static org.hamcrest.Matchers.anEmptyMap;
21+
import static org.hamcrest.Matchers.is;
2022

2123
/**
2224
* Test parsing of an eTLD from a FQDN. The list of eTLDs is maintained here:
2325
* https://github.com/publicsuffix/list/blob/master/public_suffix_list.dat
24-
*
25-
* Effective TLDs (eTLS) are not the same as DNS TLDs. Uses for eTLDs are listed here.
26+
* <p>
27+
* Effective TLDs (eTLDs) are not the same as DNS TLDs. Uses for eTLDs are listed here:
2628
* https://publicsuffix.org/learn/
2729
*/
2830
public class RegisteredDomainProcessorTests extends ESTestCase {
29-
private Map<String, Object> buildEvent(String domain) {
30-
return Map.of("domain", domain);
31-
}
3231

3332
public void testBasic() throws Exception {
34-
testRegisteredDomainProcessor(buildEvent("www.google.com"), "www.google.com", "google.com", "com", "www");
35-
testRegisteredDomainProcessor(buildEvent("google.com"), "google.com", "google.com", "com", null);
36-
testRegisteredDomainProcessor(buildEvent(""), null, null, null, null);
37-
testRegisteredDomainProcessor(buildEvent("."), null, null, null, null);
38-
testRegisteredDomainProcessor(buildEvent("$"), null, null, null, null);
39-
testRegisteredDomainProcessor(buildEvent("foo.bar.baz"), null, null, null, null);
40-
testRegisteredDomainProcessor(buildEvent("www.books.amazon.co.uk"), "www.books.amazon.co.uk", "amazon.co.uk", "co.uk", "www.books");
33+
testRegisteredDomainProcessor("www.google.com", "www.google.com", "google.com", "com", "www");
34+
testRegisteredDomainProcessor("google.com", "google.com", "google.com", "com", null);
35+
testRegisteredDomainProcessor("", null, null, null, null);
36+
testRegisteredDomainProcessor(".", null, null, null, null);
37+
testRegisteredDomainProcessor("$", null, null, null, null);
38+
testRegisteredDomainProcessor("foo.bar.baz", null, null, null, null);
39+
testRegisteredDomainProcessor("www.books.amazon.co.uk", "www.books.amazon.co.uk", "amazon.co.uk", "co.uk", "www.books");
4140
// Verify "com" is returned as the eTLD, for that FQDN or subdomain
42-
testRegisteredDomainProcessor(buildEvent("com"), "com", null, "com", null);
43-
testRegisteredDomainProcessor(buildEvent("example.com"), "example.com", "example.com", "com", null);
44-
testRegisteredDomainProcessor(buildEvent("googleapis.com"), "googleapis.com", "googleapis.com", "com", null);
41+
testRegisteredDomainProcessor("com", "com", null, "com", null);
42+
testRegisteredDomainProcessor("example.com", "example.com", "example.com", "com", null);
43+
testRegisteredDomainProcessor("googleapis.com", "googleapis.com", "googleapis.com", "com", null);
4544
testRegisteredDomainProcessor(
46-
buildEvent("content-autofill.googleapis.com"),
45+
"content-autofill.googleapis.com",
4746
"content-autofill.googleapis.com",
4847
"googleapis.com",
4948
"com",
5049
"content-autofill"
5150
);
5251
// Verify "ssl.fastly.net" is returned as the eTLD, for that FQDN or subdomain
52+
testRegisteredDomainProcessor("global.ssl.fastly.net", "global.ssl.fastly.net", "global.ssl.fastly.net", "ssl.fastly.net", null);
5353
testRegisteredDomainProcessor(
54-
buildEvent("global.ssl.fastly.net"),
55-
"global.ssl.fastly.net",
56-
"global.ssl.fastly.net",
57-
"ssl.fastly.net",
58-
null
59-
);
60-
testRegisteredDomainProcessor(
61-
buildEvent("1.www.global.ssl.fastly.net"),
54+
"1.www.global.ssl.fastly.net",
6255
"1.www.global.ssl.fastly.net",
6356
"global.ssl.fastly.net",
6457
"ssl.fastly.net",
@@ -67,76 +60,81 @@ public void testBasic() throws Exception {
6760
}
6861

6962
public void testUseRoot() throws Exception {
70-
Map<String, Object> source = buildEvent("www.google.co.uk");
71-
72-
String domainField = "domain";
73-
String registeredDomainField = "registered_domain";
74-
String topLevelDomainField = "top_level_domain";
75-
String subdomainField = "subdomain";
76-
7763
var processor = new RegisteredDomainProcessor(null, null, "domain", "", false);
78-
79-
IngestDocument input = TestIngestDocument.withDefaultVersion(source);
80-
IngestDocument output = processor.execute(input);
81-
82-
String domain = output.getFieldValue(domainField, String.class);
83-
assertThat(domain, equalTo("www.google.co.uk"));
84-
String registeredDomain = output.getFieldValue(registeredDomainField, String.class);
85-
assertThat(registeredDomain, equalTo("google.co.uk"));
86-
String eTLD = output.getFieldValue(topLevelDomainField, String.class);
87-
assertThat(eTLD, equalTo("co.uk"));
88-
String subdomain = output.getFieldValue(subdomainField, String.class);
89-
assertThat(subdomain, equalTo("www"));
64+
IngestDocument document = TestIngestDocument.withDefaultVersion(Map.of("domain", "www.google.co.uk"));
65+
processor.execute(document);
66+
assertThat(
67+
document.getSource(),
68+
is(
69+
Map.ofEntries(
70+
entry("domain", "www.google.co.uk"),
71+
entry("registered_domain", "google.co.uk"),
72+
entry("top_level_domain", "co.uk"),
73+
entry("subdomain", "www")
74+
)
75+
)
76+
);
9077
}
9178

9279
public void testError() throws Exception {
93-
IllegalArgumentException e = expectThrows(
94-
IllegalArgumentException.class,
95-
() -> testRegisteredDomainProcessor(buildEvent("foo.bar.baz"), null, null, null, null, false)
96-
);
97-
assertThat(e.getMessage(), containsString("unable to set domain information for document"));
98-
e = expectThrows(
99-
IllegalArgumentException.class,
100-
() -> testRegisteredDomainProcessor(buildEvent("$"), null, null, null, null, false)
101-
);
102-
assertThat(e.getMessage(), containsString("unable to set domain information for document"));
80+
var processor = new RegisteredDomainProcessor(null, null, "domain", "", false);
81+
82+
{
83+
IngestDocument document = TestIngestDocument.withDefaultVersion(Map.of("domain", "foo.bar.baz"));
84+
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> processor.execute(document));
85+
assertThat(e.getMessage(), is("unable to set domain information for document"));
86+
assertThat(document.getSource(), is(Map.of("domain", "foo.bar.baz")));
87+
}
88+
89+
{
90+
IngestDocument document = TestIngestDocument.withDefaultVersion(Map.of("domain", "$"));
91+
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> processor.execute(document));
92+
assertThat(e.getMessage(), is("unable to set domain information for document"));
93+
assertThat(document.getSource(), is(Map.of("domain", "$")));
94+
}
10395
}
10496

105-
private void testRegisteredDomainProcessor(
106-
Map<String, Object> source,
107-
String expectedDomain,
108-
String expectedRegisteredDomain,
109-
String expectedETLD,
110-
String expectedSubdomain
111-
) throws Exception {
112-
testRegisteredDomainProcessor(source, expectedDomain, expectedRegisteredDomain, expectedETLD, expectedSubdomain, true);
97+
public void testIgnoreMissing() throws Exception {
98+
{
99+
var processor = new RegisteredDomainProcessor(null, null, "domain", "", false);
100+
IngestDocument document = TestIngestDocument.withDefaultVersion(Map.of());
101+
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> processor.execute(document));
102+
assertThat(e.getMessage(), is("field [domain] not present as part of path [domain]"));
103+
assertThat(document.getSource(), is(anEmptyMap()));
104+
}
105+
106+
{
107+
var processor = new RegisteredDomainProcessor(null, null, "domain", "", true);
108+
IngestDocument document = TestIngestDocument.withDefaultVersion(Collections.singletonMap("domain", null));
109+
processor.execute(document);
110+
assertThat(document.getSource(), is(Collections.singletonMap("domain", null)));
111+
}
113112
}
114113

115114
private void testRegisteredDomainProcessor(
116-
Map<String, Object> source,
115+
String fqdn,
117116
String expectedDomain,
118117
String expectedRegisteredDomain,
119118
String expectedETLD,
120-
String expectedSubdomain,
121-
boolean ignoreMissing
119+
String expectedSubdomain
122120
) throws Exception {
123121
String domainField = "url.domain";
124122
String registeredDomainField = "url.registered_domain";
125123
String topLevelDomainField = "url.top_level_domain";
126124
String subdomainField = "url.subdomain";
127125

128-
var processor = new RegisteredDomainProcessor(null, null, "domain", "url", ignoreMissing);
126+
var processor = new RegisteredDomainProcessor(null, null, "domain", "url", true);
129127

130-
IngestDocument input = TestIngestDocument.withDefaultVersion(source);
131-
IngestDocument output = processor.execute(input);
128+
IngestDocument document = TestIngestDocument.withDefaultVersion(Map.of("domain", fqdn));
129+
processor.execute(document);
132130

133-
String domain = output.getFieldValue(domainField, String.class, expectedDomain == null);
134-
assertThat(domain, equalTo(expectedDomain));
135-
String registeredDomain = output.getFieldValue(registeredDomainField, String.class, expectedRegisteredDomain == null);
136-
assertThat(registeredDomain, equalTo(expectedRegisteredDomain));
137-
String eTLD = output.getFieldValue(topLevelDomainField, String.class, expectedETLD == null);
138-
assertThat(eTLD, equalTo(expectedETLD));
139-
String subdomain = output.getFieldValue(subdomainField, String.class, expectedSubdomain == null);
140-
assertThat(subdomain, equalTo(expectedSubdomain));
131+
String domain = document.getFieldValue(domainField, String.class, expectedDomain == null);
132+
assertThat(domain, is(expectedDomain));
133+
String registeredDomain = document.getFieldValue(registeredDomainField, String.class, expectedRegisteredDomain == null);
134+
assertThat(registeredDomain, is(expectedRegisteredDomain));
135+
String eTLD = document.getFieldValue(topLevelDomainField, String.class, expectedETLD == null);
136+
assertThat(eTLD, is(expectedETLD));
137+
String subdomain = document.getFieldValue(subdomainField, String.class, expectedSubdomain == null);
138+
assertThat(subdomain, is(expectedSubdomain));
141139
}
142140
}

0 commit comments

Comments
 (0)