Skip to content

Commit 6c6b11e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into prototype-skip-utf16
2 parents c38ff8a + 0e64dee commit 6c6b11e

File tree

143 files changed

+4116
-1528
lines changed

Some content is hidden

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

143 files changed

+4116
-1528
lines changed

docs/changelog/125479.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 125479
2+
summary: ES|QL - Allow full text functions to be used in STATS
3+
area: ES|QL
4+
type: enhancement
5+
issues:
6+
- 125481

docs/changelog/127796.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 127796
2+
summary: Do not respect synthetic_source_keep=arrays if type parses arrays
3+
area: Mapping
4+
type: enhancement
5+
issues:
6+
- 126155

docs/changelog/127877.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127877
2+
summary: Check hidden frames in entitlements
3+
area: Infra/Core
4+
type: bug
5+
issues: []

docs/changelog/127921.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127921
2+
summary: "[9.x] Revert \"Enable madvise by default for all builds\""
3+
area: Vector Search
4+
type: bug
5+
issues: []

docs/changelog/127949.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127949
2+
summary: Ensure ordinal builder emit ordinal blocks
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/changelog/127975.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127975
2+
summary: Fix a bug in `significant_terms`
3+
area: Aggregations
4+
type: bug
5+
issues: []

docs/reference/elasticsearch/mapping-reference/geo-point.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ of official GA features.
218218

219219

220220
Synthetic source may sort `geo_point` fields (first by latitude and then
221-
longitude) and reduces them to their stored precision. For example:
221+
longitude) and reduces them to their stored precision. Additionally, unlike most
222+
types, arrays of `geo_point` fields will not preserve order if
223+
`synthetic_source_keep` is set to `arrays`. For example:
222224

223225
$$$synthetic-source-geo-point-example$$$
224226

@@ -236,15 +238,18 @@ PUT idx
236238
},
237239
"mappings": {
238240
"properties": {
239-
"point": { "type": "geo_point" }
241+
"point": {
242+
"type": "geo_point",
243+
"synthetic_source_keep": "arrays"
244+
}
240245
}
241246
}
242247
}
243248
PUT idx/_doc/1
244249
{
245250
"point": [
246-
{"lat":-90, "lon":-80},
247-
{"lat":10, "lon":30}
251+
{"lat":10, "lon":30},
252+
{"lat":-90, "lon":-80}
248253
]
249254
}
250255
```

libs/entitlement/bridge/src/main/java/org/elasticsearch/entitlement/bridge/Util.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
package org.elasticsearch.entitlement.bridge;
1111

1212
import java.util.Optional;
13+
import java.util.Set;
1314

1415
import static java.lang.StackWalker.Option.RETAIN_CLASS_REFERENCE;
16+
import static java.lang.StackWalker.Option.SHOW_HIDDEN_FRAMES;
1517

1618
public class Util {
1719
/**
@@ -23,6 +25,8 @@ public class Util {
2325
public static final Class<?> NO_CLASS = new Object() {
2426
}.getClass();
2527

28+
private static final Set<String> skipInternalPackages = Set.of("java.lang.invoke", "java.lang.reflect", "jdk.internal.reflect");
29+
2630
/**
2731
* Why would we write this instead of using {@link StackWalker#getCallerClass()}?
2832
* Because that method throws {@link IllegalCallerException} if called from the "outermost frame",
@@ -32,9 +36,10 @@ public class Util {
3236
*/
3337
@SuppressWarnings("unused") // Called reflectively from InstrumenterImpl
3438
public static Class<?> getCallerClass() {
35-
Optional<Class<?>> callerClassIfAny = StackWalker.getInstance(RETAIN_CLASS_REFERENCE)
39+
Optional<Class<?>> callerClassIfAny = StackWalker.getInstance(Set.of(RETAIN_CLASS_REFERENCE, SHOW_HIDDEN_FRAMES))
3640
.walk(
3741
frames -> frames.skip(2) // Skip this method and its caller
42+
.filter(frame -> skipInternalPackages.contains(frame.getDeclaringClass().getPackageName()) == false)
3843
.findFirst()
3944
.map(StackWalker.StackFrame::getDeclaringClass)
4045
);

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/entitlements/FilesEntitlement.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ private static BaseDir parseBaseDir(String baseDir) {
182182
case "config" -> BaseDir.CONFIG;
183183
case "data" -> BaseDir.DATA;
184184
case "home" -> BaseDir.USER_HOME;
185-
// NOTE: shared_repo is _not_ accessible to policy files, only internally
185+
// it would be nice to limit this to just ES modules, but we don't have a way to plumb that through to here
186+
// however, we still don't document in the error case below that shared_repo is valid
187+
case "shared_repo" -> BaseDir.SHARED_REPO;
186188
default -> throw new PolicyValidationException(
187189
"invalid relative directory: " + baseDir + ", valid values: [config, data, home]"
188190
);

modules/aggregations/src/yamlRestTest/resources/rest-api-spec/test/aggregations/sig_terms.yml

Lines changed: 252 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
- match: {aggregations.class.buckets.1.sig_terms.buckets.0.key: "good"}
7474

7575
---
76-
"Test background filter count ":
76+
"Test background filter count":
7777
- requires:
7878
cluster_features: ["gte_v7.15.0"]
7979
reason: bugfix introduced in 7.15.0
@@ -153,6 +153,257 @@
153153
index: goodbad*
154154
body: {"aggs": {"sig_terms": {"significant_terms": {"field": "text", "background_filter": {"bool": {"filter": [{"term": {"class": "good" }}]}}}}}}
155155
- match: { aggregations.sig_terms.bg_count: 2 }
156+
157+
---
158+
"Test background filter count as sub - global ords":
159+
- requires:
160+
capabilities:
161+
- method: POST
162+
path: /_search
163+
capabilities: [ significant_terms_background_filter_as_sub ]
164+
test_runner_features: capabilities
165+
reason: "bug fix"
166+
167+
- do:
168+
indices.create:
169+
index: goodbad
170+
body:
171+
settings:
172+
number_of_shards: 1
173+
mappings:
174+
properties:
175+
text:
176+
type: keyword
177+
class:
178+
type: keyword
179+
- do:
180+
indices.create:
181+
index: goodbad-2
182+
body:
183+
settings:
184+
number_of_shards: 1
185+
mappings:
186+
properties:
187+
text:
188+
type: keyword
189+
class:
190+
type: keyword
191+
192+
- do:
193+
index:
194+
index: goodbad-2
195+
id: "1"
196+
body: { group: 1, class: "bad" }
197+
- do:
198+
index:
199+
index: goodbad-2
200+
id: "2"
201+
body: { group: 1, class: "bad" }
202+
203+
- do:
204+
index:
205+
index: goodbad
206+
id: "1"
207+
body: { group: 1, text: "good", class: "good" }
208+
- do:
209+
index:
210+
index: goodbad
211+
id: "2"
212+
body: { group: 1, text: "good", class: "good" }
213+
- do:
214+
index:
215+
index: goodbad
216+
id: "3"
217+
body: { group: 1, text: "bad", class: "bad" }
218+
- do:
219+
index:
220+
index: goodbad
221+
id: "4"
222+
body: { group: 2, text: "bad", class: "bad" }
223+
224+
- do:
225+
indices.refresh:
226+
index: [goodbad, goodbad-2]
227+
228+
- do:
229+
search:
230+
rest_total_hits_as_int: true
231+
index: goodbad*
232+
- match: {hits.total: 6}
233+
234+
- do:
235+
search:
236+
index: goodbad*
237+
body:
238+
aggs:
239+
group:
240+
range:
241+
field: group
242+
ranges:
243+
# Having many ranges helps catch an issue building no hits buckets
244+
- to: 1
245+
- from: 1
246+
to: 2
247+
- from: 2
248+
to: 3
249+
- from: 3
250+
to: 4
251+
- from: 4
252+
to: 5
253+
- from: 5
254+
to: 6
255+
aggs:
256+
sig_terms:
257+
significant_terms:
258+
execution_hint: global_ordinals
259+
field: text
260+
background_filter:
261+
bool:
262+
filter: [{term: {class: good }}]
263+
- match: { aggregations.group.buckets.0.key: "*-1.0" }
264+
- match: { aggregations.group.buckets.0.sig_terms.doc_count: 0 }
265+
- match: { aggregations.group.buckets.0.sig_terms.bg_count: 2 }
266+
- match: { aggregations.group.buckets.1.key: "1.0-2.0" }
267+
- match: { aggregations.group.buckets.1.sig_terms.doc_count: 5 }
268+
- match: { aggregations.group.buckets.1.sig_terms.bg_count: 2 }
269+
- match: { aggregations.group.buckets.2.key: "2.0-3.0" }
270+
- match: { aggregations.group.buckets.2.sig_terms.doc_count: 1 }
271+
- match: { aggregations.group.buckets.2.sig_terms.bg_count: 2 }
272+
- match: { aggregations.group.buckets.3.key: "3.0-4.0" }
273+
- match: { aggregations.group.buckets.3.sig_terms.doc_count: 0 }
274+
- match: { aggregations.group.buckets.3.sig_terms.bg_count: 2 }
275+
- match: { aggregations.group.buckets.4.key: "4.0-5.0" }
276+
- match: { aggregations.group.buckets.4.sig_terms.doc_count: 0 }
277+
- match: { aggregations.group.buckets.4.sig_terms.bg_count: 2 }
278+
- match: { aggregations.group.buckets.5.key: "5.0-6.0" }
279+
- match: { aggregations.group.buckets.5.sig_terms.doc_count: 0 }
280+
- match: { aggregations.group.buckets.5.sig_terms.bg_count: 2 }
281+
282+
---
283+
"Test background filter count as sub - map":
284+
- requires:
285+
capabilities:
286+
- method: POST
287+
path: /_search
288+
capabilities: [ significant_terms_background_filter_as_sub ]
289+
test_runner_features: capabilities
290+
reason: "bug fix"
291+
292+
- do:
293+
indices.create:
294+
index: goodbad
295+
body:
296+
settings:
297+
number_of_shards: 1
298+
mappings:
299+
properties:
300+
text:
301+
type: keyword
302+
class:
303+
type: keyword
304+
- do:
305+
indices.create:
306+
index: goodbad-2
307+
body:
308+
settings:
309+
number_of_shards: 1
310+
mappings:
311+
properties:
312+
text:
313+
type: keyword
314+
class:
315+
type: keyword
316+
317+
- do:
318+
index:
319+
index: goodbad-2
320+
id: "1"
321+
body: { group: 1, class: "bad" }
322+
- do:
323+
index:
324+
index: goodbad-2
325+
id: "2"
326+
body: { group: 1, class: "bad" }
327+
328+
- do:
329+
index:
330+
index: goodbad
331+
id: "1"
332+
body: { group: 1, text: "good", class: "good" }
333+
- do:
334+
index:
335+
index: goodbad
336+
id: "2"
337+
body: { group: 1, text: "good", class: "good" }
338+
- do:
339+
index:
340+
index: goodbad
341+
id: "3"
342+
body: { group: 1, text: "bad", class: "bad" }
343+
- do:
344+
index:
345+
index: goodbad
346+
id: "4"
347+
body: { group: 2, text: "bad", class: "bad" }
348+
349+
- do:
350+
indices.refresh:
351+
index: [goodbad, goodbad-2]
352+
353+
- do:
354+
search:
355+
rest_total_hits_as_int: true
356+
index: goodbad*
357+
- match: {hits.total: 6}
358+
359+
- do:
360+
search:
361+
index: goodbad*
362+
body:
363+
aggs:
364+
group:
365+
range:
366+
field: group
367+
ranges:
368+
# Having many ranges helps catch an issue building no hits buckets
369+
- to: 1
370+
- from: 1
371+
to: 2
372+
- from: 2
373+
to: 3
374+
- from: 3
375+
to: 4
376+
- from: 4
377+
to: 5
378+
- from: 5
379+
to: 6
380+
aggs:
381+
sig_terms:
382+
significant_terms:
383+
execution_hint: map
384+
field: text
385+
background_filter:
386+
bool:
387+
filter: [{term: {class: good }}]
388+
- match: { aggregations.group.buckets.0.key: "*-1.0" }
389+
- match: { aggregations.group.buckets.0.sig_terms.doc_count: 0 }
390+
- match: { aggregations.group.buckets.0.sig_terms.bg_count: 2 }
391+
- match: { aggregations.group.buckets.1.key: "1.0-2.0" }
392+
- match: { aggregations.group.buckets.1.sig_terms.doc_count: 5 }
393+
- match: { aggregations.group.buckets.1.sig_terms.bg_count: 2 }
394+
- match: { aggregations.group.buckets.2.key: "2.0-3.0" }
395+
- match: { aggregations.group.buckets.2.sig_terms.doc_count: 1 }
396+
- match: { aggregations.group.buckets.2.sig_terms.bg_count: 2 }
397+
- match: { aggregations.group.buckets.3.key: "3.0-4.0" }
398+
- match: { aggregations.group.buckets.3.sig_terms.doc_count: 0 }
399+
- match: { aggregations.group.buckets.3.sig_terms.bg_count: 2 }
400+
- match: { aggregations.group.buckets.4.key: "4.0-5.0" }
401+
- match: { aggregations.group.buckets.4.sig_terms.doc_count: 0 }
402+
- match: { aggregations.group.buckets.4.sig_terms.bg_count: 2 }
403+
- match: { aggregations.group.buckets.5.key: "5.0-6.0" }
404+
- match: { aggregations.group.buckets.5.sig_terms.doc_count: 0 }
405+
- match: { aggregations.group.buckets.5.sig_terms.bg_count: 2 }
406+
156407
---
157408
"IP test":
158409
- do:

0 commit comments

Comments
 (0)