File tree Expand file tree Collapse file tree 2 files changed +78
-4
lines changed
server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite
x-pack/plugin/src/test/resources/rest-api-spec/test/unsigned_long Expand file tree Collapse file tree 2 files changed +78
-4
lines changed Original file line number Diff line number Diff line change @@ -146,11 +146,8 @@ private int compareValues(long v1, long v2) {
146146 void setAfter (Comparable value ) {
147147 if (missingBucket && value == null ) {
148148 afterValue = null ;
149- } else if (value instanceof Number ) {
150- afterValue = ((Number ) value ).longValue ();
151149 } else {
152- // for date histogram source with "format", the after value is formatted
153- // as a string so we need to retrieve the original value in milliseconds.
150+ // parse the value from a string in case it is a date or a formatted unsigned long.
154151 afterValue = format .parseLong (value .toString (), false , () -> {
155152 throw new IllegalArgumentException ("now() is not supported in [after] key" );
156153 });
Original file line number Diff line number Diff line change @@ -299,3 +299,80 @@ setup:
299299 - match : { hits.hits.2.fields.ul.0 : "9223372036854775808" }
300300 - match : { hits.hits.3.fields.ul.0 : "18446744073709551614" }
301301 - match : { hits.hits.4.fields.ul.0 : "18446744073709551615" }
302+
303+ ---
304+ " Composite aggregations " :
305+ - skip :
306+ version : " - 7.99.99"
307+ reason : " TODO: unsigned_long support for composite aggs was fixed in 7.11"
308+
309+ - do :
310+ search :
311+ index : test1
312+ body :
313+ size : 0
314+ aggs :
315+ test :
316+ composite :
317+ size : 3
318+ sources : [{
319+ " ul " : {
320+ " terms " : {
321+ " field " : " ul"
322+ }
323+ }
324+ }]
325+
326+ - set : { aggregations.test.after_key: after_key }
327+ - length : { aggregations.test.buckets: 3 }
328+ - match : { aggregations.test.buckets.0.key.ul: 0 }
329+ - match : { aggregations.test.buckets.0.doc_count: 1 }
330+ - match : { aggregations.test.buckets.1.key.ul: 9223372036854775807 }
331+ - match : { aggregations.test.buckets.1.doc_count: 1 }
332+ - match : { aggregations.test.buckets.2.key.ul: 9223372036854775808 }
333+ - match : { aggregations.test.buckets.2.doc_count: 1 }
334+
335+ - do :
336+ search :
337+ index : test1
338+ body :
339+ size : 0
340+ aggs :
341+ test :
342+ composite :
343+ size : 3
344+ after : $after_key
345+ sources : [{
346+ " ul " : {
347+ " terms " : {
348+ " field " : " ul"
349+ }
350+ }
351+ }]
352+
353+ - set : { aggregations.test.after_key: after_key }
354+ - length : { aggregations.test.buckets: 2 }
355+ - match : { aggregations.test.buckets.0.key.ul: 18446744073709551614 }
356+ - match : { aggregations.test.buckets.0.doc_count: 1 }
357+ - match : { aggregations.test.buckets.1.key.ul: 18446744073709551615 }
358+ - match : { aggregations.test.buckets.1.doc_count: 1 }
359+
360+ - do :
361+ search :
362+ index : test1
363+ body :
364+ size : 0
365+ aggs :
366+ test :
367+ composite :
368+ size : 3
369+ after : $after_key
370+ sources : [{
371+ " ul " : {
372+ " terms " : {
373+ " field " : " ul"
374+ }
375+ }
376+ }]
377+
378+ - length : { aggregations.test.buckets: 0 }
You can’t perform that action at this time.
0 commit comments