Skip to content

Commit

Permalink
[codegen] update to latest api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta committed Jun 20, 2024
1 parent da3e9af commit 26dab96
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public enum CalendarInterval implements JsonEnum {

Quarter("quarter", "1q"),

Year("year", "1Y"),
Year("year", "1y"),

;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import jakarta.json.stream.JsonGenerator;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Long;
import java.lang.String;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -110,6 +111,9 @@ public class TermsAggregation extends BucketAggregationBase
@Nullable
private final Script script;

@Nullable
private final Long shardMinDocCount;

@Nullable
private final Integer shardSize;

Expand Down Expand Up @@ -138,6 +142,7 @@ private TermsAggregation(Builder builder) {
this.valueType = builder.valueType;
this.order = ApiTypeHelper.unmodifiable(builder.order);
this.script = builder.script;
this.shardMinDocCount = builder.shardMinDocCount;
this.shardSize = builder.shardSize;
this.showTermDocCountError = builder.showTermDocCountError;
this.size = builder.size;
Expand Down Expand Up @@ -291,6 +296,19 @@ public final Script script() {
return this.script;
}

/**
* Regulates the certainty a shard has if the term should actually be added to
* the candidate list or not with respect to the <code>min_doc_count</code>.
* Terms will only be considered if their local shard frequency within the set
* is higher than the <code>shard_min_doc_count</code>.
* <p>
* API name: {@code shard_min_doc_count}
*/
@Nullable
public final Long shardMinDocCount() {
return this.shardMinDocCount;
}

/**
* The number of candidate terms produced by each shard. By default,
* <code>shard_size</code> will be automatically estimated based on the number
Expand Down Expand Up @@ -408,6 +426,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("script");
this.script.serialize(generator, mapper);

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

}
if (this.shardSize != null) {
generator.writeKey("shard_size");
Expand Down Expand Up @@ -482,6 +505,9 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder<Builde
@Nullable
private Script script;

@Nullable
private Long shardMinDocCount;

@Nullable
private Integer shardSize;

Expand Down Expand Up @@ -707,6 +733,19 @@ public final Builder script(Function<Script.Builder, ObjectBuilder<Script>> fn)
return this.script(fn.apply(new Script.Builder()).build());
}

/**
* Regulates the certainty a shard has if the term should actually be added to
* the candidate list or not with respect to the <code>min_doc_count</code>.
* Terms will only be considered if their local shard frequency within the set
* is higher than the <code>shard_min_doc_count</code>.
* <p>
* API name: {@code shard_min_doc_count}
*/
public final Builder shardMinDocCount(@Nullable Long value) {
this.shardMinDocCount = value;
return this;
}

/**
* The number of candidate terms produced by each shard. By default,
* <code>shard_size</code> will be automatically estimated based on the number
Expand Down Expand Up @@ -790,6 +829,7 @@ protected static void setupTermsAggregationDeserializer(ObjectDeserializer<Terms
op.add(Builder::order,
JsonpDeserializer.arrayDeserializer(NamedValue.deserializer(() -> SortOrder._DESERIALIZER)), "order");
op.add(Builder::script, Script._DESERIALIZER, "script");
op.add(Builder::shardMinDocCount, JsonpDeserializer.longDeserializer(), "shard_min_doc_count");
op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size");
op.add(Builder::showTermDocCountError, JsonpDeserializer.booleanDeserializer(), "show_term_doc_count_error");
op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@
'_types.aggregations.CardinalityAggregate': '_types/aggregations/Aggregate.ts#L138-L141',
'_types.aggregations.CardinalityAggregation': '_types/aggregations/metric.ts#L87-L99',
'_types.aggregations.CardinalityExecutionMode': '_types/aggregations/metric.ts#L64-L85',
'_types.aggregations.CategorizeTextAggregation': '_types/aggregations/bucket.ts#L1040-L1104',
'_types.aggregations.CategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1106-L1109',
'_types.aggregations.CategorizeTextAggregation': '_types/aggregations/bucket.ts#L1045-L1109',
'_types.aggregations.CategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1111-L1114',
'_types.aggregations.ChiSquareHeuristic': '_types/aggregations/bucket.ts#L737-L746',
'_types.aggregations.ChildrenAggregate': '_types/aggregations/Aggregate.ts#L776-L777',
'_types.aggregations.ChildrenAggregation': '_types/aggregations/bucket.ts#L113-L118',
Expand All @@ -413,7 +413,7 @@
'_types.aggregations.CumulativeCardinalityAggregate': '_types/aggregations/Aggregate.ts#L747-L755',
'_types.aggregations.CumulativeCardinalityAggregation': '_types/aggregations/pipeline.ts#L192-L192',
'_types.aggregations.CumulativeSumAggregation': '_types/aggregations/pipeline.ts#L194-L194',
'_types.aggregations.CustomCategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1111-L1115',
'_types.aggregations.CustomCategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1116-L1120',
'_types.aggregations.DateHistogramAggregate': '_types/aggregations/Aggregate.ts#L348-L349',
'_types.aggregations.DateHistogramAggregation': '_types/aggregations/bucket.ts#L191-L249',
'_types.aggregations.DateHistogramBucket': '_types/aggregations/Aggregate.ts#L351-L354',
Expand All @@ -440,9 +440,9 @@
'_types.aggregations.FormatMetricAggregationBase': '_types/aggregations/metric.ts#L47-L49',
'_types.aggregations.FormattableMetricAggregation': '_types/aggregations/metric.ts#L51-L53',
'_types.aggregations.FrequentItemSetsAggregate': '_types/aggregations/Aggregate.ts#L639-L640',
'_types.aggregations.FrequentItemSetsAggregation': '_types/aggregations/bucket.ts#L1162-L1186',
'_types.aggregations.FrequentItemSetsAggregation': '_types/aggregations/bucket.ts#L1167-L1191',
'_types.aggregations.FrequentItemSetsBucket': '_types/aggregations/Aggregate.ts#L642-L645',
'_types.aggregations.FrequentItemSetsField': '_types/aggregations/bucket.ts#L1148-L1160',
'_types.aggregations.FrequentItemSetsField': '_types/aggregations/bucket.ts#L1153-L1165',
'_types.aggregations.GapPolicy': '_types/aggregations/pipeline.ts#L61-L76',
'_types.aggregations.GeoBoundsAggregate': '_types/aggregations/Aggregate.ts#L303-L306',
'_types.aggregations.GeoBoundsAggregation': '_types/aggregations/metric.ts#L108-L114',
Expand Down Expand Up @@ -484,7 +484,7 @@
'_types.aggregations.InferenceFeatureImportance': '_types/aggregations/Aggregate.ts#L678-L682',
'_types.aggregations.InferenceTopClassEntry': '_types/aggregations/Aggregate.ts#L672-L676',
'_types.aggregations.IpPrefixAggregate': '_types/aggregations/Aggregate.ts#L629-L630',
'_types.aggregations.IpPrefixAggregation': '_types/aggregations/bucket.ts#L1117-L1146',
'_types.aggregations.IpPrefixAggregation': '_types/aggregations/bucket.ts#L1122-L1151',
'_types.aggregations.IpPrefixBucket': '_types/aggregations/Aggregate.ts#L632-L637',
'_types.aggregations.IpRangeAggregate': '_types/aggregations/Aggregate.ts#L556-L558',
'_types.aggregations.IpRangeAggregation': '_types/aggregations/bucket.ts#L550-L559',
Expand Down Expand Up @@ -587,13 +587,13 @@
'_types.aggregations.TTestAggregation': '_types/aggregations/metric.ts#L294-L308',
'_types.aggregations.TTestType': '_types/aggregations/metric.ts#L322-L335',
'_types.aggregations.TermsAggregateBase': '_types/aggregations/Aggregate.ts#L377-L382',
'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L912-L972',
'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L982-L991',
'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L993-L998',
'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L912-L977',
'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L987-L996',
'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L998-L1003',
'_types.aggregations.TermsBucketBase': '_types/aggregations/Aggregate.ts#L391-L393',
'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L1003-L1004',
'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L1000-L1001',
'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L1006-L1015',
'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L1008-L1009',
'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L1005-L1006',
'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L1011-L1020',
'_types.aggregations.TestPopulation': '_types/aggregations/metric.ts#L310-L320',
'_types.aggregations.TopHitsAggregate': '_types/aggregations/Aggregate.ts#L654-L657',
'_types.aggregations.TopHitsAggregation': '_types/aggregations/metric.ts#L337-L397',
Expand All @@ -609,7 +609,7 @@
'_types.aggregations.ValueCountAggregation': '_types/aggregations/metric.ts#L422-L422',
'_types.aggregations.ValueType': '_types/aggregations/metric.ts#L424-L435',
'_types.aggregations.VariableWidthHistogramAggregate': '_types/aggregations/Aggregate.ts#L362-L364',
'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L1017-L1038',
'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L1022-L1043',
'_types.aggregations.VariableWidthHistogramBucket': '_types/aggregations/Aggregate.ts#L366-L373',
'_types.aggregations.WeightedAverageAggregation': '_types/aggregations/metric.ts#L437-L451',
'_types.aggregations.WeightedAverageValue': '_types/aggregations/metric.ts#L453-L463',
Expand Down Expand Up @@ -2721,10 +2721,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/42a458c196b1b8a82a1931f4879ccc17466c6f2c/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/7dcdabcae2f5644c64e0a94446c7ae012e70a05c/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/42a458c196b1b8a82a1931f4879ccc17466c6f2c/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/7dcdabcae2f5644c64e0a94446c7ae012e70a05c/specification/">Elasticsearch API specification</a>.
</body>
</html>

0 comments on commit 26dab96

Please sign in to comment.