Skip to content

Commit 72b480a

Browse files
Merge branch 'main' into esql_grid_aggs
2 parents 437a513 + e9a8efe commit 72b480a

File tree

62 files changed

+2883
-93
lines changed

Some content is hidden

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

62 files changed

+2883
-93
lines changed

docs/changelog/127009.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 127009
2+
summary: "ESQL: Keep `DROP` attributes when resolving field names"
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 126418

docs/changelog/127254.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127254
2+
summary: "[ML] Add HuggingFace Chat Completion support to the Inference Plugin"
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/127910.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127910
2+
summary: Add Microsoft Graph Delegated Authorization Realm Plugin
3+
area: Authorization
4+
type: enhancement
5+
issues: []

docs/changelog/127991.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 127991
2+
summary: Avoid nested docs in painless execute api
3+
area: Infra/Scripting
4+
type: bug
5+
issues:
6+
- 41004

modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,8 @@ private static Response prepareRamIndex(
831831
// This is a problem especially for indices that have no mappings, as no fields will be accessible, neither through doc
832832
// nor _source (if there are no mappings there are no metadata fields).
833833
ParsedDocument parsedDocument = documentMapper.parse(sourceToParse);
834-
indexWriter.addDocuments(parsedDocument.docs());
834+
// only index the root doc since nested docs are not supported in painless anyways
835+
indexWriter.addDocuments(List.of(parsedDocument.rootDoc()));
835836
try (IndexReader indexReader = DirectoryReader.open(indexWriter)) {
836837
final IndexSearcher searcher = new IndexSearcher(indexReader);
837838
searcher.setQueryCache(null);

modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteApiTests.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ public void testDefaults() throws IOException {
7070
assertThat(e.getCause().getMessage(), equalTo("cannot resolve symbol [doc]"));
7171
}
7272

73+
public void testNestedDocs() throws IOException {
74+
ScriptService scriptService = getInstanceFromNode(ScriptService.class);
75+
IndexService indexService = createIndex("index", Settings.EMPTY, "doc", "rank", "type=long", "nested", "type=nested");
76+
77+
Request.ContextSetup contextSetup = new Request.ContextSetup("index", new BytesArray("""
78+
{"rank": 4.0, "nested": [{"text": "foo"}, {"text": "bar"}]}"""), new MatchAllQueryBuilder());
79+
contextSetup.setXContentType(XContentType.JSON);
80+
Request request = new Request(new Script(ScriptType.INLINE, "painless", "doc['rank'].value", Map.of()), "score", contextSetup);
81+
Response response = innerShardOperation(request, scriptService, indexService);
82+
assertThat(response.getResult(), equalTo(4.0D));
83+
}
84+
7385
public void testFilterExecutionContext() throws IOException {
7486
ScriptService scriptService = getInstanceFromNode(ScriptService.class);
7587
IndexService indexService = createIndex("index", Settings.EMPTY, "doc", "field", "type=long");

muted-tests.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -447,15 +447,6 @@ tests:
447447
- class: org.elasticsearch.indices.stats.IndexStatsIT
448448
method: testThrottleStats
449449
issue: https://github.com/elastic/elasticsearch/issues/126359
450-
- class: org.elasticsearch.search.vectors.IVFKnnFloatVectorQueryTests
451-
method: testRandomWithFilter
452-
issue: https://github.com/elastic/elasticsearch/issues/127963
453-
- class: org.elasticsearch.search.vectors.IVFKnnFloatVectorQueryTests
454-
method: testSearchBoost
455-
issue: https://github.com/elastic/elasticsearch/issues/127969
456-
- class: org.elasticsearch.search.vectors.IVFKnnFloatVectorQueryTests
457-
method: testFindFewer
458-
issue: https://github.com/elastic/elasticsearch/issues/128002
459450
- class: org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityRestIT
460451
method: testTaskCancellation
461452
issue: https://github.com/elastic/elasticsearch/issues/128009
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
apply plugin: "elasticsearch.internal-java-rest-test"
11+
12+
esplugin {
13+
name = "microsoft-graph-authz"
14+
description = "Microsoft Graph Delegated Authorization Realm Plugin"
15+
classname = "org.elasticsearch.xpack.security.authz.microsoft.MicrosoftGraphAuthzPlugin"
16+
extendedPlugins = ["x-pack-security"]
17+
}
18+
19+
dependencies {
20+
compileOnly project(":x-pack:plugin:core")
21+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
import org.elasticsearch.xpack.security.authz.microsoft.MicrosoftGraphAuthzPlugin;
11+
12+
module org.elasticsearch.plugin.security.authz {
13+
requires org.elasticsearch.base;
14+
requires org.elasticsearch.server;
15+
requires org.elasticsearch.xcore;
16+
requires org.elasticsearch.logging;
17+
18+
provides org.elasticsearch.xpack.core.security.SecurityExtension with MicrosoftGraphAuthzPlugin;
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.xpack.security.authz.microsoft;
11+
12+
import org.elasticsearch.common.settings.Setting;
13+
import org.elasticsearch.plugins.Plugin;
14+
import org.elasticsearch.xpack.core.security.SecurityExtension;
15+
import org.elasticsearch.xpack.core.security.authc.Realm;
16+
17+
import java.util.List;
18+
import java.util.Map;
19+
20+
public class MicrosoftGraphAuthzPlugin extends Plugin implements SecurityExtension {
21+
@Override
22+
public Map<String, Realm.Factory> getRealms(SecurityComponents components) {
23+
return Map.of(MicrosoftGraphAuthzRealmSettings.REALM_TYPE, MicrosoftGraphAuthzRealm::new);
24+
}
25+
26+
@Override
27+
public List<Setting<?>> getSettings() {
28+
return MicrosoftGraphAuthzRealmSettings.getSettings();
29+
}
30+
}

0 commit comments

Comments
 (0)