Skip to content

Commit 363075c

Browse files
committed
[codegen] update to latest api spec
1 parent 12720eb commit 363075c

File tree

3 files changed

+58
-10
lines changed

3 files changed

+58
-10
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CalendarInterval.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public enum CalendarInterval implements JsonEnum {
6060

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

63-
Year("year", "1Y"),
63+
Year("year", "1y"),
6464

6565
;
6666

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregation.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import jakarta.json.stream.JsonGenerator;
3636
import java.lang.Boolean;
3737
import java.lang.Integer;
38+
import java.lang.Long;
3839
import java.lang.String;
3940
import java.util.List;
4041
import java.util.Objects;
@@ -101,6 +102,9 @@ public class TermsAggregation extends BucketAggregationBase implements Aggregati
101102
@Nullable
102103
private final Script script;
103104

105+
@Nullable
106+
private final Long shardMinDocCount;
107+
104108
@Nullable
105109
private final Integer shardSize;
106110

@@ -127,6 +131,7 @@ private TermsAggregation(Builder builder) {
127131
this.valueType = builder.valueType;
128132
this.order = ApiTypeHelper.unmodifiable(builder.order);
129133
this.script = builder.script;
134+
this.shardMinDocCount = builder.shardMinDocCount;
130135
this.shardSize = builder.shardSize;
131136
this.showTermDocCountError = builder.showTermDocCountError;
132137
this.size = builder.size;
@@ -249,6 +254,23 @@ public final Script script() {
249254
}
250255

251256
/**
257+
* Regulates the certainty a shard has if the term should actually be added to
258+
* the candidate list or not with respect to the <code>min_doc_count</code>.
259+
* Terms will only be considered if their local shard frequency within the set
260+
* is higher than the <code>shard_min_doc_count</code>.
261+
* <p>
262+
* API name: {@code shard_min_doc_count}
263+
*/
264+
@Nullable
265+
public final Long shardMinDocCount() {
266+
return this.shardMinDocCount;
267+
}
268+
269+
/**
270+
* The number of candidate terms produced by each shard. By default,
271+
* <code>shard_size</code> will be automatically estimated based on the number
272+
* of shards and the <code>size</code> parameter.
273+
* <p>
252274
* API name: {@code shard_size}
253275
*/
254276
@Nullable
@@ -339,6 +361,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
339361
generator.writeKey("script");
340362
this.script.serialize(generator, mapper);
341363

364+
}
365+
if (this.shardMinDocCount != null) {
366+
generator.writeKey("shard_min_doc_count");
367+
generator.write(this.shardMinDocCount);
368+
342369
}
343370
if (this.shardSize != null) {
344371
generator.writeKey("shard_size");
@@ -403,6 +430,9 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder<Builde
403430
@Nullable
404431
private Script script;
405432

433+
@Nullable
434+
private Long shardMinDocCount;
435+
406436
@Nullable
407437
private Integer shardSize;
408438

@@ -581,6 +611,23 @@ public final Builder script(Function<Script.Builder, ObjectBuilder<Script>> fn)
581611
}
582612

583613
/**
614+
* Regulates the certainty a shard has if the term should actually be added to
615+
* the candidate list or not with respect to the <code>min_doc_count</code>.
616+
* Terms will only be considered if their local shard frequency within the set
617+
* is higher than the <code>shard_min_doc_count</code>.
618+
* <p>
619+
* API name: {@code shard_min_doc_count}
620+
*/
621+
public final Builder shardMinDocCount(@Nullable Long value) {
622+
this.shardMinDocCount = value;
623+
return this;
624+
}
625+
626+
/**
627+
* The number of candidate terms produced by each shard. By default,
628+
* <code>shard_size</code> will be automatically estimated based on the number
629+
* of shards and the <code>size</code> parameter.
630+
* <p>
584631
* API name: {@code shard_size}
585632
*/
586633
public final Builder shardSize(@Nullable Integer value) {
@@ -645,6 +692,7 @@ protected static void setupTermsAggregationDeserializer(ObjectDeserializer<Terms
645692
op.add(Builder::order,
646693
JsonpDeserializer.arrayDeserializer(NamedValue.deserializer(() -> SortOrder._DESERIALIZER)), "order");
647694
op.add(Builder::script, Script._DESERIALIZER, "script");
695+
op.add(Builder::shardMinDocCount, JsonpDeserializer.longDeserializer(), "shard_min_doc_count");
648696
op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size");
649697
op.add(Builder::showTermDocCountError, JsonpDeserializer.booleanDeserializer(), "show_term_doc_count_error");
650698
op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size");

java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -519,13 +519,13 @@
519519
'_types.aggregations.TTestAggregation': '_types/aggregations/metric.ts#L144-L148',
520520
'_types.aggregations.TTestType': '_types/aggregations/metric.ts#L156-L160',
521521
'_types.aggregations.TermsAggregateBase': '_types/aggregations/Aggregate.ts#L367-L372',
522-
'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L397-L413',
523-
'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L423-L426',
524-
'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L428-L433',
522+
'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L397-L422',
523+
'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L432-L435',
524+
'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L437-L442',
525525
'_types.aggregations.TermsBucketBase': '_types/aggregations/Aggregate.ts#L381-L383',
526-
'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L438-L439',
527-
'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L435-L436',
528-
'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L441-L444',
526+
'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L447-L448',
527+
'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L444-L445',
528+
'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L450-L453',
529529
'_types.aggregations.TestPopulation': '_types/aggregations/metric.ts#L150-L154',
530530
'_types.aggregations.TopHitsAggregate': '_types/aggregations/Aggregate.ts#L619-L622',
531531
'_types.aggregations.TopHitsAggregation': '_types/aggregations/metric.ts#L162-L175',
@@ -541,7 +541,7 @@
541541
'_types.aggregations.ValueCountAggregation': '_types/aggregations/metric.ts#L187-L187',
542542
'_types.aggregations.ValueType': '_types/aggregations/metric.ts#L189-L200',
543543
'_types.aggregations.VariableWidthHistogramAggregate': '_types/aggregations/Aggregate.ts#L352-L354',
544-
'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L446-L452',
544+
'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L455-L461',
545545
'_types.aggregations.VariableWidthHistogramBucket': '_types/aggregations/Aggregate.ts#L356-L363',
546546
'_types.aggregations.WeightedAverageAggregation': '_types/aggregations/metric.ts#L202-L207',
547547
'_types.aggregations.WeightedAverageValue': '_types/aggregations/metric.ts#L209-L213',
@@ -2351,10 +2351,10 @@
23512351
if (hash.length > 1) {
23522352
hash = hash.substring(1);
23532353
}
2354-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/60128dd705a0e7c7f4da6044f1c54ff6a86157eb/specification/" + (paths[hash] || "");
2354+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/eb87f7645ff2778dc459dfa63b5d5dcc342a7a1f/specification/" + (paths[hash] || "");
23552355
</script>
23562356
</head>
23572357
<body>
2358-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/60128dd705a0e7c7f4da6044f1c54ff6a86157eb/specification/">Elasticsearch API specification</a>.
2358+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/eb87f7645ff2778dc459dfa63b5d5dcc342a7a1f/specification/">Elasticsearch API specification</a>.
23592359
</body>
23602360
</html>

0 commit comments

Comments
 (0)