Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust version after backport to 1.3.0.0 #2147

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1030,3 +1030,35 @@ setup:
- length: { aggregations.test.buckets: 1 }
- match: { aggregations.test.buckets.0.key.keyword: "foo" }
- match: { aggregations.test.buckets.0.doc_count: 1 }
---
"Simple Composite aggregation with missing order":
- skip:
version: " - 1.2.99"
reason: missing_order is supported in 1.3.0.

- do:
search:
rest_total_hits_as_int: true
index: test
body:
aggregations:
test:
composite:
sources: [
"kw": {
"terms": {
"field": "keyword",
"missing_bucket": true,
"missing_order": "last"
}
}
]

- match: {hits.total: 6}
- length: { aggregations.test.buckets: 3 }
- match: { aggregations.test.buckets.0.key.kw: "bar" }
- match: { aggregations.test.buckets.0.doc_count: 3 }
- match: { aggregations.test.buckets.1.key.kw: "foo" }
- match: { aggregations.test.buckets.1.doc_count: 2 }
- match: { aggregations.test.buckets.2.key.kw: null }
- match: { aggregations.test.buckets.2.doc_count: 2 }
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public abstract class CompositeValuesSourceBuilder<AB extends CompositeValuesSou
this.userValueTypeHint = ValueType.readFromStream(in);
}
this.missingBucket = in.readBoolean();
if (in.getVersion().onOrAfter(Version.V_2_0_0)) {
if (in.getVersion().onOrAfter(Version.V_1_3_0)) {
this.missingOrder = MissingOrder.readFromStream(in);
}
this.order = SortOrder.readFromStream(in);
Expand All @@ -103,7 +103,7 @@ public final void writeTo(StreamOutput out) throws IOException {
userValueTypeHint.writeTo(out);
}
out.writeBoolean(missingBucket);
if (out.getVersion().onOrAfter(Version.V_2_0_0)) {
if (out.getVersion().onOrAfter(Version.V_1_3_0)) {
missingOrder.writeTo(out);
}
order.writeTo(out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public InternalComposite(StreamInput in) throws IOException {
formats.add(in.readNamedWriteable(DocValueFormat.class));
}
this.reverseMuls = in.readIntArray();
if (in.getVersion().onOrAfter(Version.V_2_0_0)) {
if (in.getVersion().onOrAfter(Version.V_1_3_0)) {
this.missingOrders = in.readArray(MissingOrder::readFromStream, MissingOrder[]::new);
} else {
this.missingOrders = new MissingOrder[reverseMuls.length];
Expand All @@ -123,7 +123,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
out.writeNamedWriteable(format);
}
out.writeIntArray(reverseMuls);
if (out.getVersion().onOrAfter(Version.V_2_0_0)) {
if (out.getVersion().onOrAfter(Version.V_1_3_0)) {
out.writeArray((output, order) -> order.writeTo(output), missingOrders);
}
out.writeList(buckets);
Expand Down