Skip to content

Commit

Permalink
Merge branch 'main' into bulk-ingester-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta authored Sep 12, 2024
2 parents 324af0a + 7d3ecf5 commit b1a0aa9
Show file tree
Hide file tree
Showing 526 changed files with 59,269 additions and 4,902 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ steps:
- label: ":java: :elasticsearch: Elasticsearch Java API client - {{matrix.workflow}}"
agents:
provider: "gcp"
branches: [ "main", "7.17", "8.14", "8.15" ]
branches: [ "main", "7.17", "8.15", "8.x", "9.0" ]
matrix:
setup:
workflow:
Expand Down
2 changes: 1 addition & 1 deletion config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.16.0
9.0.0

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public class KnnQuery extends QueryBase implements QueryVariant {
@Nullable
private final Integer numCandidates;

@Nullable
private final Integer k;

private final List<Query> filter;

@Nullable
Expand All @@ -86,6 +89,7 @@ private KnnQuery(Builder builder) {
this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector);
this.queryVectorBuilder = builder.queryVectorBuilder;
this.numCandidates = builder.numCandidates;
this.k = builder.k;
this.filter = ApiTypeHelper.unmodifiable(builder.filter);
this.similarity = builder.similarity;

Expand Down Expand Up @@ -142,6 +146,16 @@ public final Integer numCandidates() {
return this.numCandidates;
}

/**
* The final number of nearest neighbors to return as top hits
* <p>
* API name: {@code k}
*/
@Nullable
public final Integer k() {
return this.k;
}

/**
* Filters for the kNN search query
* <p>
Expand Down Expand Up @@ -186,6 +200,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("num_candidates");
generator.write(this.numCandidates);

}
if (this.k != null) {
generator.writeKey("k");
generator.write(this.k);

}
if (ApiTypeHelper.isDefined(this.filter)) {
generator.writeKey("filter");
Expand Down Expand Up @@ -223,6 +242,9 @@ public static class Builder extends QueryBase.AbstractBuilder<Builder> implement
@Nullable
private Integer numCandidates;

@Nullable
private Integer k;

@Nullable
private List<Query> filter;

Expand Down Expand Up @@ -295,6 +317,16 @@ public final Builder numCandidates(@Nullable Integer value) {
return this;
}

/**
* The final number of nearest neighbors to return as top hits
* <p>
* API name: {@code k}
*/
public final Builder k(@Nullable Integer value) {
this.k = value;
return this;
}

/**
* Filters for the kNN search query
* <p>
Expand Down Expand Up @@ -373,6 +405,7 @@ protected static void setupKnnQueryDeserializer(ObjectDeserializer<KnnQuery.Buil
"query_vector");
op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder");
op.add(Builder::numCandidates, JsonpDeserializer.integerDeserializer(), "num_candidates");
op.add(Builder::k, JsonpDeserializer.integerDeserializer(), "k");
op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter");
op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ public enum Kind implements JsonEnum {

TTest("t_test"),

TimeSeries("time_series"),

TopHits("top_hits"),

TopMetrics("top_metrics"),
Expand Down Expand Up @@ -1307,6 +1309,23 @@ public TTestAggregate tTest() {
return TaggedUnionUtils.get(this, Kind.TTest);
}

/**
* Is this variant instance of kind {@code time_series}?
*/
public boolean isTimeSeries() {
return _kind == Kind.TimeSeries;
}

/**
* Get the {@code time_series} variant value.
*
* @throws IllegalStateException
* if the current variant is not of the {@code time_series} kind.
*/
public TimeSeriesAggregate timeSeries() {
return TaggedUnionUtils.get(this, Kind.TimeSeries);
}

/**
* Is this variant instance of kind {@code top_hits}?
*/
Expand Down Expand Up @@ -2156,6 +2175,17 @@ public ObjectBuilder<Aggregate> tTest(Function<TTestAggregate.Builder, ObjectBui
return this.tTest(fn.apply(new TTestAggregate.Builder()).build());
}

public ObjectBuilder<Aggregate> timeSeries(TimeSeriesAggregate v) {
this._kind = Kind.TimeSeries;
this._value = v;
return this;
}

public ObjectBuilder<Aggregate> timeSeries(
Function<TimeSeriesAggregate.Builder, ObjectBuilder<TimeSeriesAggregate>> fn) {
return this.timeSeries(fn.apply(new TimeSeriesAggregate.Builder()).build());
}

public ObjectBuilder<Aggregate> topHits(TopHitsAggregate v) {
this._kind = Kind.TopHits;
this._value = v;
Expand Down Expand Up @@ -2342,6 +2372,7 @@ public Aggregate build() {
deserializers.put("tdigest_percentile_ranks", TDigestPercentileRanksAggregate._DESERIALIZER);
deserializers.put("tdigest_percentiles", TDigestPercentilesAggregate._DESERIALIZER);
deserializers.put("t_test", TTestAggregate._DESERIALIZER);
deserializers.put("time_series", TimeSeriesAggregate._DESERIALIZER);
deserializers.put("top_hits", TopHitsAggregate._DESERIALIZER);
deserializers.put("top_metrics", TopMetricsAggregate._DESERIALIZER);
deserializers.put("umrareterms", UnmappedRareTermsAggregate._DESERIALIZER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,24 @@ public static Aggregate tTest(Function<TTestAggregate.Builder, ObjectBuilder<TTe
return builder.build();
}

/**
* Creates a builder for the {@link TimeSeriesAggregate time_series}
* {@code Aggregate} variant.
*/
public static TimeSeriesAggregate.Builder timeSeries() {
return new TimeSeriesAggregate.Builder();
}

/**
* Creates a Aggregate of the {@link TimeSeriesAggregate time_series}
* {@code Aggregate} variant.
*/
public static Aggregate timeSeries(Function<TimeSeriesAggregate.Builder, ObjectBuilder<TimeSeriesAggregate>> fn) {
Aggregate.Builder builder = new Aggregate.Builder();
builder.timeSeries(fn.apply(new TimeSeriesAggregate.Builder()).build());
return builder.build();
}

/**
* Creates a builder for the {@link TopHitsAggregate top_hits} {@code Aggregate}
* variant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ public enum Kind implements JsonEnum {

Terms("terms"),

TimeSeries("time_series"),

TopHits("top_hits"),

TTest("t_test"),
Expand Down Expand Up @@ -1493,6 +1495,23 @@ public TermsAggregation terms() {
return TaggedUnionUtils.get(this, Kind.Terms);
}

/**
* Is this variant instance of kind {@code time_series}?
*/
public boolean isTimeSeries() {
return _kind == Kind.TimeSeries;
}

/**
* Get the {@code time_series} variant value.
*
* @throws IllegalStateException
* if the current variant is not of the {@code time_series} kind.
*/
public TimeSeriesAggregation timeSeries() {
return TaggedUnionUtils.get(this, Kind.TimeSeries);
}

/**
* Is this variant instance of kind {@code top_hits}?
*/
Expand Down Expand Up @@ -2477,6 +2496,17 @@ public ContainerBuilder terms(Function<TermsAggregation.Builder, ObjectBuilder<T
return this.terms(fn.apply(new TermsAggregation.Builder()).build());
}

public ContainerBuilder timeSeries(TimeSeriesAggregation v) {
this._kind = Kind.TimeSeries;
this._value = v;
return new ContainerBuilder();
}

public ContainerBuilder timeSeries(
Function<TimeSeriesAggregation.Builder, ObjectBuilder<TimeSeriesAggregation>> fn) {
return this.timeSeries(fn.apply(new TimeSeriesAggregation.Builder()).build());
}

public ContainerBuilder topHits(TopHitsAggregation v) {
this._kind = Kind.TopHits;
this._value = v;
Expand Down Expand Up @@ -2702,6 +2732,7 @@ protected static void setupAggregationDeserializer(ObjectDeserializer<Builder> o
op.add(Builder::sum, SumAggregation._DESERIALIZER, "sum");
op.add(Builder::sumBucket, SumBucketAggregation._DESERIALIZER, "sum_bucket");
op.add(Builder::terms, TermsAggregation._DESERIALIZER, "terms");
op.add(Builder::timeSeries, TimeSeriesAggregation._DESERIALIZER, "time_series");
op.add(Builder::topHits, TopHitsAggregation._DESERIALIZER, "top_hits");
op.add(Builder::tTest, TTestAggregation._DESERIALIZER, "t_test");
op.add(Builder::topMetrics, TopMetricsAggregation._DESERIALIZER, "top_metrics");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,25 @@ public static Aggregation terms(Function<TermsAggregation.Builder, ObjectBuilder
return builder.build();
}

/**
* Creates a builder for the {@link TimeSeriesAggregation time_series}
* {@code Aggregation} variant.
*/
public static TimeSeriesAggregation.Builder timeSeries() {
return new TimeSeriesAggregation.Builder();
}

/**
* Creates a Aggregation of the {@link TimeSeriesAggregation time_series}
* {@code Aggregation} variant.
*/
public static Aggregation timeSeries(
Function<TimeSeriesAggregation.Builder, ObjectBuilder<TimeSeriesAggregation>> fn) {
Aggregation.Builder builder = new Aggregation.Builder();
builder.timeSeries(fn.apply(new TimeSeriesAggregation.Builder()).build());
return builder.build();
}

/**
* Creates a builder for the {@link TopHitsAggregation top_hits}
* {@code Aggregation} variant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public static AggregationRange of(Function<Builder, ObjectBuilder<AggregationRan
* Start of the range (inclusive).
* <p>
* API name: {@code from}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
*/
@Nullable
public final Double from() {
Expand All @@ -107,6 +109,8 @@ public final String key() {
* End of the range (exclusive).
* <p>
* API name: {@code to}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
*/
@Nullable
public final Double to() {
Expand All @@ -126,8 +130,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

if (this.from != null) {
generator.writeKey("from");
generator.write(this.from);

JsonpUtils.serializeDoubleOrNull(generator, this.from, 0);
}
if (this.key != null) {
generator.writeKey("key");
Expand All @@ -136,8 +139,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
if (this.to != null) {
generator.writeKey("to");
generator.write(this.to);

JsonpUtils.serializeDoubleOrNull(generator, this.to, 0);
}

}
Expand Down Expand Up @@ -167,6 +169,8 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
* Start of the range (inclusive).
* <p>
* API name: {@code from}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
*/
public final Builder from(@Nullable Double value) {
this.from = value;
Expand All @@ -187,6 +191,8 @@ public final Builder key(@Nullable String value) {
* End of the range (exclusive).
* <p>
* API name: {@code to}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
*/
public final Builder to(@Nullable Double value) {
this.to = value;
Expand Down Expand Up @@ -221,9 +227,9 @@ public AggregationRange build() {

protected static void setupAggregationRangeDeserializer(ObjectDeserializer<AggregationRange.Builder> op) {

op.add(Builder::from, JsonpDeserializer.doubleDeserializer(), "from");
op.add(Builder::from, JsonpDeserializer.doubleOrNullDeserializer(0), "from");
op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key");
op.add(Builder::to, JsonpDeserializer.doubleDeserializer(), "to");
op.add(Builder::to, JsonpDeserializer.doubleOrNullDeserializer(0), "to");

}

Expand Down
Loading

0 comments on commit b1a0aa9

Please sign in to comment.