diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ChunkRescorerChunkingSettings.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ChunkRescorerChunkingSettings.java index 3eb0d870c9..f15ab2ee96 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ChunkRescorerChunkingSettings.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ChunkRescorerChunkingSettings.java @@ -62,32 +62,32 @@ */ @JsonpDeserializable public class ChunkRescorerChunkingSettings implements JsonpSerializable { + private final int maxChunkSize; + @Nullable - private final String strategy; + private final Integer overlap; + + @Nullable + private final Integer sentenceOverlap; @Nullable private final String separatorGroup; private final List separators; - private final int maxChunkSize; - - @Nullable - private final Integer overlap; - @Nullable - private final Integer sentenceOverlap; + private final String strategy; // --------------------------------------------------------------------------------------------- private ChunkRescorerChunkingSettings(Builder builder) { - this.strategy = builder.strategy; - this.separatorGroup = builder.separatorGroup; - this.separators = ApiTypeHelper.unmodifiable(builder.separators); this.maxChunkSize = ApiTypeHelper.requireNonNull(builder.maxChunkSize, this, "maxChunkSize", 0); this.overlap = builder.overlap; this.sentenceOverlap = builder.sentenceOverlap; + this.separatorGroup = builder.separatorGroup; + this.separators = ApiTypeHelper.unmodifiable(builder.separators); + this.strategy = builder.strategy; } @@ -96,24 +96,39 @@ public static ChunkRescorerChunkingSettings of(Functionsentence, word, - * none or recursive. - * - * + * Required - The maximum size of a chunk in words. This value cannot be lower + * than 20 (for sentence strategy) or 10 + * (for word strategy). This value should not exceed the window + * size for the associated model. *

- * Learn more about different chunking strategies in the linked documentation. + * API name: {@code max_chunk_size} + */ + public final int maxChunkSize() { + return this.maxChunkSize; + } + + /** + * The number of overlapping words for chunks. It is applicable only to a + * word chunking strategy. This value cannot be higher than half + * the max_chunk_size value. *

- * API name: {@code strategy} + * API name: {@code overlap} */ @Nullable - public final String strategy() { - return this.strategy; + public final Integer overlap() { + return this.overlap; + } + + /** + * The number of overlapping sentences for chunks. It is applicable only for a + * sentence chunking strategy. It can be either 1 or + * 0. + *

+ * API name: {@code sentence_overlap} + */ + @Nullable + public final Integer sentenceOverlap() { + return this.sentenceOverlap; } /** @@ -155,39 +170,24 @@ public final List separators() { } /** - * Required - The maximum size of a chunk in words. This value cannot be lower - * than 20 (for sentence strategy) or 10 - * (for word strategy). This value should not exceed the window - * size for the associated model. - *

- * API name: {@code max_chunk_size} - */ - public final int maxChunkSize() { - return this.maxChunkSize; - } - - /** - * The number of overlapping words for chunks. It is applicable only to a - * word chunking strategy. This value cannot be higher than half - * the max_chunk_size value. + * The chunking strategy: sentence, word, + * none or recursive. + *

+ * *

- * API name: {@code overlap} - */ - @Nullable - public final Integer overlap() { - return this.overlap; - } - - /** - * The number of overlapping sentences for chunks. It is applicable only for a - * sentence chunking strategy. It can be either 1 or - * 0. + * Learn more about different chunking strategies in the linked documentation. *

- * API name: {@code sentence_overlap} + * API name: {@code strategy} */ @Nullable - public final Integer sentenceOverlap() { - return this.sentenceOverlap; + public final String strategy() { + return this.strategy; } /** @@ -201,9 +201,17 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.strategy != null) { - generator.writeKey("strategy"); - generator.write(this.strategy); + generator.writeKey("max_chunk_size"); + generator.write(this.maxChunkSize); + + if (this.overlap != null) { + generator.writeKey("overlap"); + generator.write(this.overlap); + + } + if (this.sentenceOverlap != null) { + generator.writeKey("sentence_overlap"); + generator.write(this.sentenceOverlap); } if (this.separatorGroup != null) { @@ -221,17 +229,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - generator.writeKey("max_chunk_size"); - generator.write(this.maxChunkSize); - - if (this.overlap != null) { - generator.writeKey("overlap"); - generator.write(this.overlap); - - } - if (this.sentenceOverlap != null) { - generator.writeKey("sentence_overlap"); - generator.write(this.sentenceOverlap); + if (this.strategy != null) { + generator.writeKey("strategy"); + generator.write(this.strategy); } @@ -251,52 +251,68 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private String strategy; + private Integer maxChunkSize; @Nullable - private String separatorGroup; + private Integer overlap; @Nullable - private List separators; + private Integer sentenceOverlap; - private Integer maxChunkSize; + @Nullable + private String separatorGroup; @Nullable - private Integer overlap; + private List separators; @Nullable - private Integer sentenceOverlap; + private String strategy; public Builder() { } private Builder(ChunkRescorerChunkingSettings instance) { - this.strategy = instance.strategy; - this.separatorGroup = instance.separatorGroup; - this.separators = instance.separators; this.maxChunkSize = instance.maxChunkSize; this.overlap = instance.overlap; this.sentenceOverlap = instance.sentenceOverlap; + this.separatorGroup = instance.separatorGroup; + this.separators = instance.separators; + this.strategy = instance.strategy; } /** - * The chunking strategy: sentence, word, - * none or recursive. - *

- * + * Required - The maximum size of a chunk in words. This value cannot be lower + * than 20 (for sentence strategy) or 10 + * (for word strategy). This value should not exceed the window + * size for the associated model. *

- * Learn more about different chunking strategies in the linked documentation. + * API name: {@code max_chunk_size} + */ + public final Builder maxChunkSize(int value) { + this.maxChunkSize = value; + return this; + } + + /** + * The number of overlapping words for chunks. It is applicable only to a + * word chunking strategy. This value cannot be higher than half + * the max_chunk_size value. *

- * API name: {@code strategy} + * API name: {@code overlap} */ - public final Builder strategy(@Nullable String value) { - this.strategy = value; + public final Builder overlap(@Nullable Integer value) { + this.overlap = value; + return this; + } + + /** + * The number of overlapping sentences for chunks. It is applicable only for a + * sentence chunking strategy. It can be either 1 or + * 0. + *

+ * API name: {@code sentence_overlap} + */ + public final Builder sentenceOverlap(@Nullable Integer value) { + this.sentenceOverlap = value; return this; } @@ -365,39 +381,23 @@ public final Builder separators(String value, String... values) { } /** - * Required - The maximum size of a chunk in words. This value cannot be lower - * than 20 (for sentence strategy) or 10 - * (for word strategy). This value should not exceed the window - * size for the associated model. - *

- * API name: {@code max_chunk_size} - */ - public final Builder maxChunkSize(int value) { - this.maxChunkSize = value; - return this; - } - - /** - * The number of overlapping words for chunks. It is applicable only to a - * word chunking strategy. This value cannot be higher than half - * the max_chunk_size value. + * The chunking strategy: sentence, word, + * none or recursive. + *

+ * *

- * API name: {@code overlap} - */ - public final Builder overlap(@Nullable Integer value) { - this.overlap = value; - return this; - } - - /** - * The number of overlapping sentences for chunks. It is applicable only for a - * sentence chunking strategy. It can be either 1 or - * 0. + * Learn more about different chunking strategies in the linked documentation. *

- * API name: {@code sentence_overlap} + * API name: {@code strategy} */ - public final Builder sentenceOverlap(@Nullable Integer value) { - this.sentenceOverlap = value; + public final Builder strategy(@Nullable String value) { + this.strategy = value; return this; } @@ -436,13 +436,13 @@ public Builder rebuild() { protected static void setupChunkRescorerChunkingSettingsDeserializer( ObjectDeserializer op) { - op.add(Builder::strategy, JsonpDeserializer.stringDeserializer(), "strategy"); - op.add(Builder::separatorGroup, JsonpDeserializer.stringDeserializer(), "separator_group"); - op.add(Builder::separators, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "separators"); op.add(Builder::maxChunkSize, JsonpDeserializer.integerDeserializer(), "max_chunk_size"); op.add(Builder::overlap, JsonpDeserializer.integerDeserializer(), "overlap"); op.add(Builder::sentenceOverlap, JsonpDeserializer.integerDeserializer(), "sentence_overlap"); + op.add(Builder::separatorGroup, JsonpDeserializer.stringDeserializer(), "separator_group"); + op.add(Builder::separators, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "separators"); + op.add(Builder::strategy, JsonpDeserializer.stringDeserializer(), "strategy"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ChunkingSettings.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ChunkingSettings.java index e0b0e90811..1ad098946d 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ChunkingSettings.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ChunkingSettings.java @@ -64,11 +64,6 @@ public class ChunkingSettings implements JsonpSerializable { private final String strategy; - @Nullable - private final String separatorGroup; - - private final List separators; - private final int maxChunkSize; @Nullable @@ -77,16 +72,21 @@ public class ChunkingSettings implements JsonpSerializable { @Nullable private final Integer sentenceOverlap; + @Nullable + private final String separatorGroup; + + private final List separators; + // --------------------------------------------------------------------------------------------- private ChunkingSettings(Builder builder) { this.strategy = ApiTypeHelper.requireNonNull(builder.strategy, this, "strategy"); - this.separatorGroup = builder.separatorGroup; - this.separators = ApiTypeHelper.unmodifiable(builder.separators); this.maxChunkSize = ApiTypeHelper.requireNonNull(builder.maxChunkSize, this, "maxChunkSize", 0); this.overlap = builder.overlap; this.sentenceOverlap = builder.sentenceOverlap; + this.separatorGroup = builder.separatorGroup; + this.separators = ApiTypeHelper.unmodifiable(builder.separators); } @@ -114,6 +114,42 @@ public final String strategy() { return this.strategy; } + /** + * Required - The maximum size of a chunk in words. This value cannot be lower + * than 20 (for sentence strategy) or 10 + * (for word strategy). This value should not exceed the window + * size for the associated model. + *

+ * API name: {@code max_chunk_size} + */ + public final int maxChunkSize() { + return this.maxChunkSize; + } + + /** + * The number of overlapping words for chunks. It is applicable only to a + * word chunking strategy. This value cannot be higher than half + * the max_chunk_size value. + *

+ * API name: {@code overlap} + */ + @Nullable + public final Integer overlap() { + return this.overlap; + } + + /** + * The number of overlapping sentences for chunks. It is applicable only for a + * sentence chunking strategy. It can be either 1 or + * 0. + *

+ * API name: {@code sentence_overlap} + */ + @Nullable + public final Integer sentenceOverlap() { + return this.sentenceOverlap; + } + /** * Only applicable to the recursive strategy and required when * using it. @@ -152,42 +188,6 @@ public final List separators() { return this.separators; } - /** - * Required - The maximum size of a chunk in words. This value cannot be lower - * than 20 (for sentence strategy) or 10 - * (for word strategy). This value should not exceed the window - * size for the associated model. - *

- * API name: {@code max_chunk_size} - */ - public final int maxChunkSize() { - return this.maxChunkSize; - } - - /** - * The number of overlapping words for chunks. It is applicable only to a - * word chunking strategy. This value cannot be higher than half - * the max_chunk_size value. - *

- * API name: {@code overlap} - */ - @Nullable - public final Integer overlap() { - return this.overlap; - } - - /** - * The number of overlapping sentences for chunks. It is applicable only for a - * sentence chunking strategy. It can be either 1 or - * 0. - *

- * API name: {@code sentence_overlap} - */ - @Nullable - public final Integer sentenceOverlap() { - return this.sentenceOverlap; - } - /** * Serialize this object to JSON. */ @@ -202,6 +202,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("strategy"); generator.write(this.strategy); + generator.writeKey("max_chunk_size"); + generator.write(this.maxChunkSize); + + if (this.overlap != null) { + generator.writeKey("overlap"); + generator.write(this.overlap); + + } + if (this.sentenceOverlap != null) { + generator.writeKey("sentence_overlap"); + generator.write(this.sentenceOverlap); + + } if (this.separatorGroup != null) { generator.writeKey("separator_group"); generator.write(this.separatorGroup); @@ -217,19 +230,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - generator.writeKey("max_chunk_size"); - generator.write(this.maxChunkSize); - - if (this.overlap != null) { - generator.writeKey("overlap"); - generator.write(this.overlap); - - } - if (this.sentenceOverlap != null) { - generator.writeKey("sentence_overlap"); - generator.write(this.sentenceOverlap); - - } } @@ -247,12 +247,6 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { private String strategy; - @Nullable - private String separatorGroup; - - @Nullable - private List separators; - private Integer maxChunkSize; @Nullable @@ -261,15 +255,21 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Integer sentenceOverlap; + @Nullable + private String separatorGroup; + + @Nullable + private List separators; + public Builder() { } private Builder(ChunkingSettings instance) { this.strategy = instance.strategy; - this.separatorGroup = instance.separatorGroup; - this.separators = instance.separators; this.maxChunkSize = instance.maxChunkSize; this.overlap = instance.overlap; this.sentenceOverlap = instance.sentenceOverlap; + this.separatorGroup = instance.separatorGroup; + this.separators = instance.separators; } /** @@ -293,6 +293,43 @@ public final Builder strategy(String value) { return this; } + /** + * Required - The maximum size of a chunk in words. This value cannot be lower + * than 20 (for sentence strategy) or 10 + * (for word strategy). This value should not exceed the window + * size for the associated model. + *

+ * API name: {@code max_chunk_size} + */ + public final Builder maxChunkSize(int value) { + this.maxChunkSize = value; + return this; + } + + /** + * The number of overlapping words for chunks. It is applicable only to a + * word chunking strategy. This value cannot be higher than half + * the max_chunk_size value. + *

+ * API name: {@code overlap} + */ + public final Builder overlap(@Nullable Integer value) { + this.overlap = value; + return this; + } + + /** + * The number of overlapping sentences for chunks. It is applicable only for a + * sentence chunking strategy. It can be either 1 or + * 0. + *

+ * API name: {@code sentence_overlap} + */ + public final Builder sentenceOverlap(@Nullable Integer value) { + this.sentenceOverlap = value; + return this; + } + /** * Only applicable to the recursive strategy and required when * using it. @@ -357,43 +394,6 @@ public final Builder separators(String value, String... values) { return this; } - /** - * Required - The maximum size of a chunk in words. This value cannot be lower - * than 20 (for sentence strategy) or 10 - * (for word strategy). This value should not exceed the window - * size for the associated model. - *

- * API name: {@code max_chunk_size} - */ - public final Builder maxChunkSize(int value) { - this.maxChunkSize = value; - return this; - } - - /** - * The number of overlapping words for chunks. It is applicable only to a - * word chunking strategy. This value cannot be higher than half - * the max_chunk_size value. - *

- * API name: {@code overlap} - */ - public final Builder overlap(@Nullable Integer value) { - this.overlap = value; - return this; - } - - /** - * The number of overlapping sentences for chunks. It is applicable only for a - * sentence chunking strategy. It can be either 1 or - * 0. - *

- * API name: {@code sentence_overlap} - */ - public final Builder sentenceOverlap(@Nullable Integer value) { - this.sentenceOverlap = value; - return this; - } - @Override protected Builder self() { return this; @@ -429,12 +429,12 @@ public Builder rebuild() { protected static void setupChunkingSettingsDeserializer(ObjectDeserializer op) { op.add(Builder::strategy, JsonpDeserializer.stringDeserializer(), "strategy"); - op.add(Builder::separatorGroup, JsonpDeserializer.stringDeserializer(), "separator_group"); - op.add(Builder::separators, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "separators"); op.add(Builder::maxChunkSize, JsonpDeserializer.integerDeserializer(), "max_chunk_size"); op.add(Builder::overlap, JsonpDeserializer.integerDeserializer(), "overlap"); op.add(Builder::sentenceOverlap, JsonpDeserializer.integerDeserializer(), "sentence_overlap"); + op.add(Builder::separatorGroup, JsonpDeserializer.stringDeserializer(), "separator_group"); + op.add(Builder::separators, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "separators"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoPolygonQuery.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoPolygonQuery.java index c345530c62..c91740f22c 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoPolygonQuery.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoPolygonQuery.java @@ -55,9 +55,7 @@ * @see API * specification - * @deprecated 7.12.0 Use geo-shape instead. */ -@Deprecated @JsonpDeserializable public class GeoPolygonQuery extends QueryBase implements QueryVariant { private final String field; @@ -146,7 +144,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { /** * Builder for {@link GeoPolygonQuery}. */ - @Deprecated + public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { private String field; diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateRequest.java index 6f95e0a08f..aa1dc1c045 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateRequest.java @@ -159,8 +159,8 @@ public final Boolean allowNoIndices() { } /** - * If true, network round-trips are minimized for cross-cluster - * search requests. + * Indicates whether network round-trips should be minimized as part of + * cross-cluster search requests execution. *

* API name: {@code ccs_minimize_roundtrips} */ @@ -465,8 +465,8 @@ public final Builder allowNoIndices(@Nullable Boolean value) { } /** - * If true, network round-trips are minimized for cross-cluster - * search requests. + * Indicates whether network round-trips should be minimized as part of + * cross-cluster search requests execution. *

* API name: {@code ccs_minimize_roundtrips} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggester.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggester.java index e092319231..2c59b08eaa 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggester.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggester.java @@ -93,9 +93,6 @@ public class PhraseSuggester extends SuggesterBase implements FieldSuggesterVari @Nullable private final SmoothingModel smoothing; - @Nullable - private final String text; - @Nullable private final Integer tokenLimit; @@ -115,7 +112,6 @@ private PhraseSuggester(Builder builder) { this.separator = builder.separator; this.shardSize = builder.shardSize; this.smoothing = builder.smoothing; - this.text = builder.text; this.tokenLimit = builder.tokenLimit; } @@ -255,16 +251,6 @@ public final SmoothingModel smoothing() { return this.smoothing; } - /** - * The text/query to provide suggestions for. - *

- * API name: {@code text} - */ - @Nullable - public final String text() { - return this.text; - } - /** * API name: {@code token_limit} */ @@ -335,11 +321,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("smoothing"); this.smoothing.serialize(generator, mapper); - } - if (this.text != null) { - generator.writeKey("text"); - generator.write(this.text); - } if (this.tokenLimit != null) { generator.writeKey("token_limit"); @@ -391,9 +372,6 @@ public static class Builder extends SuggesterBase.AbstractBuilder @Nullable private SmoothingModel smoothing; - @Nullable - private String text; - @Nullable private Integer tokenLimit; @@ -411,7 +389,6 @@ private Builder(PhraseSuggester instance) { this.separator = instance.separator; this.shardSize = instance.shardSize; this.smoothing = instance.smoothing; - this.text = instance.text; this.tokenLimit = instance.tokenLimit; } @@ -610,16 +587,6 @@ public final Builder smoothing(SmoothingModelVariant value) { return this; } - /** - * The text/query to provide suggestions for. - *

- * API name: {@code text} - */ - public final Builder text(@Nullable String value) { - this.text = value; - return this; - } - /** * API name: {@code token_limit} */ @@ -674,7 +641,6 @@ protected static void setupPhraseSuggesterDeserializer(ObjectDeserializer - * API name: {@code text} - */ - @Nullable - public final String text() { - return this.text; - } - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { super.serializeInternal(generator, mapper); @@ -317,11 +302,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("suggest_mode"); this.suggestMode.serialize(generator, mapper); } - if (this.text != null) { - generator.writeKey("text"); - generator.write(this.text); - - } } @@ -365,9 +345,6 @@ public static class Builder extends SuggesterBase.AbstractBuilder imple @Nullable private SuggestMode suggestMode; - @Nullable - private String text; - public Builder() { } private Builder(TermSuggester instance) { @@ -382,7 +359,6 @@ private Builder(TermSuggester instance) { this.sort = instance.sort; this.stringDistance = instance.stringDistance; this.suggestMode = instance.suggestMode; - this.text = instance.text; } /** @@ -509,16 +485,6 @@ public final Builder suggestMode(@Nullable SuggestMode value) { return this; } - /** - * The suggest text. Needs to be set globally or per suggestion. - *

- * API name: {@code text} - */ - public final Builder text(@Nullable String value) { - this.text = value; - return this; - } - @Override protected Builder self() { return this; @@ -564,7 +530,6 @@ protected static void setupTermSuggesterDeserializer(ObjectDeserializer 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/e19c0a81f07307768d2b3db53a8d885a25479d34/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/2e838917453ed9903a2f335754a5a3e88e72d6e1/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java index f83700cd8c..eee8ba7616 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java @@ -4764,6 +4764,10 @@ public CompletableFuture shardStores() { * Before shrinking, a (primary or replica) copy of every shard in the index * must be present on the same node. *

+ * IMPORTANT: If the source index already has one primary shard, configuring the + * shrink operation with 'index.number_of_shards: 1' will cause the request to + * fail. An index with one primary shard cannot be shrunk further. + *

* The current write index on a data stream cannot be shrunk. In order to shrink * the current write index, the data stream must first be rolled over so that a * new write index is created and then the previous write index can be shrunk. @@ -4835,6 +4839,10 @@ public CompletableFuture shrink(ShrinkRequest request) { * Before shrinking, a (primary or replica) copy of every shard in the index * must be present on the same node. *

+ * IMPORTANT: If the source index already has one primary shard, configuring the + * shrink operation with 'index.number_of_shards: 1' will cause the request to + * fail. An index with one primary shard cannot be shrunk further. + *

* The current write index on a data stream cannot be shrunk. In order to shrink * the current write index, the data stream must first be rolled over so that a * new write index is created and then the previous write index can be shrunk. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java index ef1fe79f76..26dde46b7a 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java @@ -4833,6 +4833,10 @@ public ShardStoresResponse shardStores() throws IOException, ElasticsearchExcept * Before shrinking, a (primary or replica) copy of every shard in the index * must be present on the same node. *

+ * IMPORTANT: If the source index already has one primary shard, configuring the + * shrink operation with 'index.number_of_shards: 1' will cause the request to + * fail. An index with one primary shard cannot be shrunk further. + *

* The current write index on a data stream cannot be shrunk. In order to shrink * the current write index, the data stream must first be rolled over so that a * new write index is created and then the previous write index can be shrunk. @@ -4904,6 +4908,10 @@ public ShrinkResponse shrink(ShrinkRequest request) throws IOException, Elastics * Before shrinking, a (primary or replica) copy of every shard in the index * must be present on the same node. *

+ * IMPORTANT: If the source index already has one primary shard, configuring the + * shrink operation with 'index.number_of_shards: 1' will cause the request to + * fail. An index with one primary shard cannot be shrunk further. + *

* The current write index on a data stream cannot be shrunk. In order to shrink * the current write index, the data stream must first be rolled over so that a * new write index is created and then the previous write index can be shrunk. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ShrinkRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ShrinkRequest.java index 94bd852f82..e3187b2104 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ShrinkRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ShrinkRequest.java @@ -83,6 +83,10 @@ * Before shrinking, a (primary or replica) copy of every shard in the index * must be present on the same node. *

+ * IMPORTANT: If the source index already has one primary shard, configuring the + * shrink operation with 'index.number_of_shards: 1' will cause the request to + * fail. An index with one primary shard cannot be shrunk further. + *

* The current write index on a data stream cannot be shrunk. In order to shrink * the current write index, the data stream must first be rolled over so that a * new write index is created and then the previous write index can be shrunk. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/validate_query/IndicesValidationExplanation.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/validate_query/IndicesValidationExplanation.java index 152286470a..c31e140b49 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/validate_query/IndicesValidationExplanation.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/validate_query/IndicesValidationExplanation.java @@ -31,6 +31,7 @@ import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; +import java.lang.Integer; import java.lang.String; import java.util.Objects; import java.util.function.Function; @@ -67,8 +68,12 @@ public class IndicesValidationExplanation implements JsonpSerializable { @Nullable private final String explanation; + @Nullable private final String index; + @Nullable + private final Integer shard; + private final boolean valid; // --------------------------------------------------------------------------------------------- @@ -77,7 +82,8 @@ private IndicesValidationExplanation(Builder builder) { this.error = builder.error; this.explanation = builder.explanation; - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + this.index = builder.index; + this.shard = builder.shard; this.valid = ApiTypeHelper.requireNonNull(builder.valid, this, "valid", false); } @@ -103,12 +109,21 @@ public final String explanation() { } /** - * Required - API name: {@code index} + * API name: {@code index} */ + @Nullable public final String index() { return this.index; } + /** + * API name: {@code shard} + */ + @Nullable + public final Integer shard() { + return this.shard; + } + /** * Required - API name: {@code valid} */ @@ -137,9 +152,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.explanation); } - generator.writeKey("index"); - generator.write(this.index); + if (this.index != null) { + generator.writeKey("index"); + generator.write(this.index); + + } + if (this.shard != null) { + generator.writeKey("shard"); + generator.write(this.shard); + } generator.writeKey("valid"); generator.write(this.valid); @@ -165,8 +187,12 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private String explanation; + @Nullable private String index; + @Nullable + private Integer shard; + private Boolean valid; public Builder() { @@ -175,6 +201,7 @@ private Builder(IndicesValidationExplanation instance) { this.error = instance.error; this.explanation = instance.explanation; this.index = instance.index; + this.shard = instance.shard; this.valid = instance.valid; } @@ -195,13 +222,21 @@ public final Builder explanation(@Nullable String value) { } /** - * Required - API name: {@code index} + * API name: {@code index} */ - public final Builder index(String value) { + public final Builder index(@Nullable String value) { this.index = value; return this; } + /** + * API name: {@code shard} + */ + public final Builder shard(@Nullable Integer value) { + this.shard = value; + return this; + } + /** * Required - API name: {@code valid} */ @@ -248,6 +283,7 @@ protected static void setupIndicesValidationExplanationDeserializer( op.add(Builder::error, JsonpDeserializer.stringDeserializer(), "error"); op.add(Builder::explanation, JsonpDeserializer.stringDeserializer(), "explanation"); op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::shard, JsonpDeserializer.integerDeserializer(), "shard"); op.add(Builder::valid, JsonpDeserializer.booleanDeserializer(), "valid"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java index fbfba54b30..fe93f86862 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java @@ -420,7 +420,8 @@ public final CompletableFuture inference( *

  • OpenShift AI (chat_completion, completion, * rerank, text_embedding)
  • *
  • VoyageAI (rerank, text_embedding)
  • - *
  • Watsonx inference integration (text_embedding)
  • + *
  • Watsonx (chat_completion, completion, + * rerank, text_embedding)
  • * * * @see put(PutRequest request) { *
  • OpenShift AI (chat_completion, completion, * rerank, text_embedding)
  • *
  • VoyageAI (rerank, text_embedding)
  • - *
  • Watsonx inference integration (text_embedding)
  • + *
  • Watsonx (chat_completion, completion, + * rerank, text_embedding)
  • * * * @param fn diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java index 2bc66b9705..bf8fee366d 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java @@ -421,7 +421,8 @@ public final InferenceResponse inference(FunctionOpenShift AI (chat_completion, completion, * rerank, text_embedding) *
  • VoyageAI (rerank, text_embedding)
  • - *
  • Watsonx inference integration (text_embedding)
  • + *
  • Watsonx (chat_completion, completion, + * rerank, text_embedding)
  • * * * @see
    OpenShift AI (chat_completion, completion, * rerank, text_embedding) *
  • VoyageAI (rerank, text_embedding)
  • - *
  • Watsonx inference integration (text_embedding)
  • + *
  • Watsonx (chat_completion, completion, + * rerank, text_embedding)
  • * * * @param fn diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java index b8bfe8aad9..418f30b8ce 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java @@ -112,7 +112,8 @@ *
  • OpenShift AI (chat_completion, completion, * rerank, text_embedding)
  • *
  • VoyageAI (rerank, text_embedding)
  • - *
  • Watsonx inference integration (text_embedding)
  • + *
  • Watsonx (chat_completion, completion, + * rerank, text_embedding)
  • * * * @see
    API diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutWatsonxRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutWatsonxRequest.java index 3d6d38979c..65d7a7ac3a 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutWatsonxRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutWatsonxRequest.java @@ -105,7 +105,8 @@ public static PutWatsonxRequest of(Functiontext_embedding task type. Not applicable to the - * completion or chat_completion task types. + * rerank, completion or chat_completion + * task types. *

    * API name: {@code chunking_settings} */ @@ -223,7 +224,8 @@ private Builder(PutWatsonxRequest instance) { /** * The chunking configuration object. Applies only to the * text_embedding task type. Not applicable to the - * completion or chat_completion task types. + * rerank, completion or chat_completion + * task types. *

    * API name: {@code chunking_settings} */ @@ -235,7 +237,8 @@ public final Builder chunkingSettings(@Nullable InferenceChunkingSettings value) /** * The chunking configuration object. Applies only to the * text_embedding task type. Not applicable to the - * completion or chat_completion task types. + * rerank, completion or chat_completion + * task types. *

    * API name: {@code chunking_settings} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/WatsonxTaskType.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/WatsonxTaskType.java index 5162fa3e3a..375737ed08 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/WatsonxTaskType.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/WatsonxTaskType.java @@ -48,6 +48,8 @@ public enum WatsonxTaskType implements JsonEnum { TextEmbedding("text_embedding"), + Rerank("rerank"), + ChatCompletion("chat_completion"), Completion("completion"), diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/DeprecationsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/DeprecationsRequest.java index a15cd1e6b8..0196fd4425 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/DeprecationsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/DeprecationsRequest.java @@ -57,13 +57,24 @@ /** * Get deprecation information. *

    - * Get information about different cluster, node, and index level settings that - * use deprecated features that will be removed or changed in the next major - * version. + * Returns information about deprecated features which are in use in the + * cluster. The reported features include cluster, node, and index level + * settings that will be removed or changed in the next major version. You must + * address the reported issues before upgrading to the next major version. + * However, no action is required when upgrading within the current major + * version. Deprecated features remain fully supported and will continue to work + * in the current version, and when upgrading to a newer minor or patch release + * in the same major version. Use this API to review your usage of these + * features and migrate away from them at your own pace, before upgrading to a + * new major version.

    *

    - * TIP: This APIs is designed for indirect use by the Upgrade Assistant. You are - * strongly recommended to use the Upgrade Assistant. - * + * info This API is designed for indirect use by the Upgrade + * Assistant. We recommend learning about deprecated features using the + * Upgrade Assistant rather than calling this API directly. + *

    + *
    + * * @see API * specification */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/ElasticsearchMigrationAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/ElasticsearchMigrationAsyncClient.java index 87e301a9bc..e9d3a15770 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/ElasticsearchMigrationAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/ElasticsearchMigrationAsyncClient.java @@ -72,13 +72,24 @@ public ElasticsearchMigrationAsyncClient withTransportOptions(@Nullable Transpor /** * Get deprecation information. *

    - * Get information about different cluster, node, and index level settings that - * use deprecated features that will be removed or changed in the next major - * version. + * Returns information about deprecated features which are in use in the + * cluster. The reported features include cluster, node, and index level + * settings that will be removed or changed in the next major version. You must + * address the reported issues before upgrading to the next major version. + * However, no action is required when upgrading within the current major + * version. Deprecated features remain fully supported and will continue to work + * in the current version, and when upgrading to a newer minor or patch release + * in the same major version. Use this API to review your usage of these + * features and migrate away from them at your own pace, before upgrading to a + * new major version.

    *

    - * TIP: This APIs is designed for indirect use by the Upgrade Assistant. You are - * strongly recommended to use the Upgrade Assistant. - * + * info This API is designed for indirect use by the Upgrade + * Assistant. We recommend learning about deprecated features using the + * Upgrade Assistant rather than calling this API directly. + *

    + *
    + * * @see Documentation * on elastic.co @@ -94,13 +105,24 @@ public CompletableFuture deprecations(DeprecationsRequest /** * Get deprecation information. *

    - * Get information about different cluster, node, and index level settings that - * use deprecated features that will be removed or changed in the next major - * version. + * Returns information about deprecated features which are in use in the + * cluster. The reported features include cluster, node, and index level + * settings that will be removed or changed in the next major version. You must + * address the reported issues before upgrading to the next major version. + * However, no action is required when upgrading within the current major + * version. Deprecated features remain fully supported and will continue to work + * in the current version, and when upgrading to a newer minor or patch release + * in the same major version. Use this API to review your usage of these + * features and migrate away from them at your own pace, before upgrading to a + * new major version.

    *

    - * TIP: This APIs is designed for indirect use by the Upgrade Assistant. You are - * strongly recommended to use the Upgrade Assistant. - * + * info This API is designed for indirect use by the Upgrade + * Assistant. We recommend learning about deprecated features using the + * Upgrade Assistant rather than calling this API directly. + *

    + *
    + * * @param fn * a function that initializes a builder to create the * {@link DeprecationsRequest} @@ -117,13 +139,24 @@ public final CompletableFuture deprecations( /** * Get deprecation information. *

    - * Get information about different cluster, node, and index level settings that - * use deprecated features that will be removed or changed in the next major - * version. + * Returns information about deprecated features which are in use in the + * cluster. The reported features include cluster, node, and index level + * settings that will be removed or changed in the next major version. You must + * address the reported issues before upgrading to the next major version. + * However, no action is required when upgrading within the current major + * version. Deprecated features remain fully supported and will continue to work + * in the current version, and when upgrading to a newer minor or patch release + * in the same major version. Use this API to review your usage of these + * features and migrate away from them at your own pace, before upgrading to a + * new major version.

    *

    - * TIP: This APIs is designed for indirect use by the Upgrade Assistant. You are - * strongly recommended to use the Upgrade Assistant. - * + * info This API is designed for indirect use by the Upgrade + * Assistant. We recommend learning about deprecated features using the + * Upgrade Assistant rather than calling this API directly. + *

    + *
    + * * @see Documentation * on elastic.co diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/ElasticsearchMigrationClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/ElasticsearchMigrationClient.java index 17f1634a08..d5f3ab6a4e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/ElasticsearchMigrationClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/migration/ElasticsearchMigrationClient.java @@ -70,13 +70,24 @@ public ElasticsearchMigrationClient withTransportOptions(@Nullable TransportOpti /** * Get deprecation information. *

    - * Get information about different cluster, node, and index level settings that - * use deprecated features that will be removed or changed in the next major - * version. + * Returns information about deprecated features which are in use in the + * cluster. The reported features include cluster, node, and index level + * settings that will be removed or changed in the next major version. You must + * address the reported issues before upgrading to the next major version. + * However, no action is required when upgrading within the current major + * version. Deprecated features remain fully supported and will continue to work + * in the current version, and when upgrading to a newer minor or patch release + * in the same major version. Use this API to review your usage of these + * features and migrate away from them at your own pace, before upgrading to a + * new major version.

    *

    - * TIP: This APIs is designed for indirect use by the Upgrade Assistant. You are - * strongly recommended to use the Upgrade Assistant. - * + * info This API is designed for indirect use by the Upgrade + * Assistant. We recommend learning about deprecated features using the + * Upgrade Assistant rather than calling this API directly. + *

    + *
    + * * @see Documentation * on elastic.co @@ -92,13 +103,24 @@ public DeprecationsResponse deprecations(DeprecationsRequest request) throws IOE /** * Get deprecation information. *

    - * Get information about different cluster, node, and index level settings that - * use deprecated features that will be removed or changed in the next major - * version. + * Returns information about deprecated features which are in use in the + * cluster. The reported features include cluster, node, and index level + * settings that will be removed or changed in the next major version. You must + * address the reported issues before upgrading to the next major version. + * However, no action is required when upgrading within the current major + * version. Deprecated features remain fully supported and will continue to work + * in the current version, and when upgrading to a newer minor or patch release + * in the same major version. Use this API to review your usage of these + * features and migrate away from them at your own pace, before upgrading to a + * new major version.

    *

    - * TIP: This APIs is designed for indirect use by the Upgrade Assistant. You are - * strongly recommended to use the Upgrade Assistant. - * + * info This API is designed for indirect use by the Upgrade + * Assistant. We recommend learning about deprecated features using the + * Upgrade Assistant rather than calling this API directly. + *

    + *
    + * * @param fn * a function that initializes a builder to create the * {@link DeprecationsRequest} @@ -116,13 +138,24 @@ public final DeprecationsResponse deprecations( /** * Get deprecation information. *

    - * Get information about different cluster, node, and index level settings that - * use deprecated features that will be removed or changed in the next major - * version. + * Returns information about deprecated features which are in use in the + * cluster. The reported features include cluster, node, and index level + * settings that will be removed or changed in the next major version. You must + * address the reported issues before upgrading to the next major version. + * However, no action is required when upgrading within the current major + * version. Deprecated features remain fully supported and will continue to work + * in the current version, and when upgrading to a newer minor or patch release + * in the same major version. Use this API to review your usage of these + * features and migrate away from them at your own pace, before upgrading to a + * new major version.

    *

    - * TIP: This APIs is designed for indirect use by the Upgrade Assistant. You are - * strongly recommended to use the Upgrade Assistant. - * + * info This API is designed for indirect use by the Upgrade + * Assistant. We recommend learning about deprecated features using the + * Upgrade Assistant rather than calling this API directly. + *

    + *
    + * * @see Documentation * on elastic.co diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/AnalysisConfigRead.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/AnalysisConfigRead.java index a459adc79a..98ad1a1691 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/AnalysisConfigRead.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/AnalysisConfigRead.java @@ -64,6 +64,10 @@ public class AnalysisConfigRead implements JsonpSerializable { private final Time bucketSpan; + private final List detectors; + + private final List influencers; + @Nullable private final CategorizationAnalyzer categorizationAnalyzer; @@ -72,15 +76,11 @@ public class AnalysisConfigRead implements JsonpSerializable { private final List categorizationFilters; - private final List detectors; - - private final List influencers; - @Nullable - private final Time modelPruneWindow; + private final Time latency; @Nullable - private final Time latency; + private final Time modelPruneWindow; @Nullable private final Boolean multivariateByFields; @@ -96,13 +96,13 @@ public class AnalysisConfigRead implements JsonpSerializable { private AnalysisConfigRead(Builder builder) { this.bucketSpan = ApiTypeHelper.requireNonNull(builder.bucketSpan, this, "bucketSpan"); + this.detectors = ApiTypeHelper.unmodifiableRequired(builder.detectors, this, "detectors"); + this.influencers = ApiTypeHelper.unmodifiableRequired(builder.influencers, this, "influencers"); this.categorizationAnalyzer = builder.categorizationAnalyzer; this.categorizationFieldName = builder.categorizationFieldName; this.categorizationFilters = ApiTypeHelper.unmodifiable(builder.categorizationFilters); - this.detectors = ApiTypeHelper.unmodifiableRequired(builder.detectors, this, "detectors"); - this.influencers = ApiTypeHelper.unmodifiableRequired(builder.influencers, this, "influencers"); - this.modelPruneWindow = builder.modelPruneWindow; this.latency = builder.latency; + this.modelPruneWindow = builder.modelPruneWindow; this.multivariateByFields = builder.multivariateByFields; this.perPartitionCategorization = builder.perPartitionCategorization; this.summaryCountFieldName = builder.summaryCountFieldName; @@ -115,7 +115,11 @@ public static AnalysisConfigRead of(Function5m and 1h. + * typically between 5m and 1h. This value should be + * either a whole number of days or equate to a whole number of buckets in one + * day. If the anomaly detection job uses a datafeed with aggregations, this + * value must also be divisible by the interval of the date histogram + * aggregation. *

    * API name: {@code bucket_span} */ @@ -123,13 +127,41 @@ public final Time bucketSpan() { return this.bucketSpan; } + /** + * Required - Detector configuration objects specify which data fields a job + * analyzes. They also specify which analytical functions are used. You can + * specify multiple detectors for a job. If the detectors array does not contain + * at least one detector, no analysis can occur and an error is returned. + *

    + * API name: {@code detectors} + */ + public final List detectors() { + return this.detectors; + } + + /** + * Required - A comma separated list of influencer field names. Typically these + * can be the by, over, or partition fields that are used in the detector + * configuration. You might also want to use a field name that is not + * specifically named in a detector, but is available as part of the input data. + * When you use multiple detectors, the use of influencers is recommended as it + * aggregates results for each influencer entity. + *

    + * API name: {@code influencers} + */ + public final List influencers() { + return this.influencers; + } + /** * If categorization_field_name is specified, you can also define * the analyzer that is used to interpret the categorization field. This * property cannot be used at the same time as * categorization_filters. The categorization analyzer specifies * how the categorization_field is interpreted by the - * categorization process. + * categorization process. The categorization_analyzer field can be + * specified either as a string or as an object. If it is a string, it must + * refer to a built-in analyzer or one added by another plugin. *

    * API name: {@code categorization_analyzer} */ @@ -155,7 +187,16 @@ public final String categorizationFieldName() { * If categorization_field_name is specified, you can also define * optional filters. This property expects an array of regular expressions. The * expressions are used to filter out matching sequences from the categorization - * field values. + * field values. You can use this functionality to fine tune the categorization + * by excluding sequences from consideration when categories are defined. For + * example, you can exclude SQL statements that appear in your log files. This + * property cannot be used at the same time as + * categorization_analyzer. If you only want to define simple + * regular expression filters that are applied prior to tokenization, setting + * this property is the easiest method. If you also want to customize the + * tokenizer or post-tokenization filtering, use the + * categorization_analyzer property instead and include the filters + * as pattern_replace character filters. The effect is exactly the same. *

    * API name: {@code categorization_filters} */ @@ -164,37 +205,23 @@ public final List categorizationFilters() { } /** - * Required - An array of detector configuration objects. Detector configuration - * objects specify which data fields a job analyzes. They also specify which - * analytical functions are used. You can specify multiple detectors for a job. - *

    - * API name: {@code detectors} - */ - public final List detectors() { - return this.detectors; - } - - /** - * Required - A comma separated list of influencer field names. Typically these - * can be the by, over, or partition fields that are used in the detector - * configuration. You might also want to use a field name that is not - * specifically named in a detector, but is available as part of the input data. - * When you use multiple detectors, the use of influencers is recommended as it - * aggregates results for each influencer entity. + * The size of the window in which to expect data that is out of time order. If + * you specify a non-zero value, it must be greater than or equal to one second. + * NOTE: Latency is applicable only when you send data by using the post data + * API. *

    - * API name: {@code influencers} + * API name: {@code latency} */ - public final List influencers() { - return this.influencers; + @Nullable + public final Time latency() { + return this.latency; } /** * Advanced configuration option. Affects the pruning of models that have not * been updated for the given time duration. The value must be set to a multiple * of the bucket_span. If set too low, important information may be - * removed from the model. Typically, set to 30d or longer. If not - * set, model pruning only occurs if the model memory status reaches the soft - * limit or the hard limit. For jobs created in 8.1 and later, the default value + * removed from the model. For jobs created in 8.1 and later, the default value * is the greater of 30d or 20 times bucket_span. *

    * API name: {@code model_prune_window} @@ -204,24 +231,20 @@ public final Time modelPruneWindow() { return this.modelPruneWindow; } - /** - * The size of the window in which to expect data that is out of time order. - * Defaults to no latency. If you specify a non-zero value, it must be greater - * than or equal to one second. - *

    - * API name: {@code latency} - */ - @Nullable - public final Time latency() { - return this.latency; - } - /** * This functionality is reserved for internal use. It is not supported for use * in customer environments and is not subject to the support SLA of official GA * features. If set to true, the analysis will automatically find * correlations between metrics for a given by field value and report anomalies - * when those correlations cease to hold. + * when those correlations cease to hold. For example, suppose CPU and memory + * usage on host A is usually highly correlated with the same metrics on host B. + * Perhaps this correlation occurs because they are running a load-balanced + * application. If you enable this property, anomalies will be reported when, + * for example, CPU usage on host A is high and the value of CPU usage on host B + * is low. That is to say, you’ll see an anomaly when the CPU of host A is + * unusual given the CPU of host B. To use the + * multivariate_by_fields property, you must also specify + * by_field_name in your detector. *

    * API name: {@code multivariate_by_fields} */ @@ -245,6 +268,8 @@ public final PerPartitionCategorization perPartitionCategorization() { * be pre-summarized. This property value is the name of the field that contains * the count of raw data points that have been summarized. The same * summary_count_field_name applies to all detectors in the job. + * NOTE: The summary_count_field_name property cannot be used with + * the metric function. *

    * API name: {@code summary_count_field_name} */ @@ -267,26 +292,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("bucket_span"); this.bucketSpan.serialize(generator, mapper); - if (this.categorizationAnalyzer != null) { - generator.writeKey("categorization_analyzer"); - this.categorizationAnalyzer.serialize(generator, mapper); - - } - if (this.categorizationFieldName != null) { - generator.writeKey("categorization_field_name"); - generator.write(this.categorizationFieldName); - - } - if (ApiTypeHelper.isDefined(this.categorizationFilters)) { - generator.writeKey("categorization_filters"); - generator.writeStartArray(); - for (String item0 : this.categorizationFilters) { - generator.write(item0); - - } - generator.writeEnd(); - - } if (ApiTypeHelper.isDefined(this.detectors)) { generator.writeKey("detectors"); generator.writeStartArray(); @@ -307,15 +312,35 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (this.modelPruneWindow != null) { - generator.writeKey("model_prune_window"); - this.modelPruneWindow.serialize(generator, mapper); + if (this.categorizationAnalyzer != null) { + generator.writeKey("categorization_analyzer"); + this.categorizationAnalyzer.serialize(generator, mapper); + + } + if (this.categorizationFieldName != null) { + generator.writeKey("categorization_field_name"); + generator.write(this.categorizationFieldName); + + } + if (ApiTypeHelper.isDefined(this.categorizationFilters)) { + generator.writeKey("categorization_filters"); + generator.writeStartArray(); + for (String item0 : this.categorizationFilters) { + generator.write(item0); + + } + generator.writeEnd(); } if (this.latency != null) { generator.writeKey("latency"); this.latency.serialize(generator, mapper); + } + if (this.modelPruneWindow != null) { + generator.writeKey("model_prune_window"); + this.modelPruneWindow.serialize(generator, mapper); + } if (this.multivariateByFields != null) { generator.writeKey("multivariate_by_fields"); @@ -351,6 +376,10 @@ public static class Builder extends WithJsonObjectBuilderBase ObjectBuilder { private Time bucketSpan; + private List detectors; + + private List influencers; + @Nullable private CategorizationAnalyzer categorizationAnalyzer; @@ -360,15 +389,11 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private List categorizationFilters; - private List detectors; - - private List influencers; - @Nullable - private Time modelPruneWindow; + private Time latency; @Nullable - private Time latency; + private Time modelPruneWindow; @Nullable private Boolean multivariateByFields; @@ -383,13 +408,13 @@ public Builder() { } private Builder(AnalysisConfigRead instance) { this.bucketSpan = instance.bucketSpan; + this.detectors = instance.detectors; + this.influencers = instance.influencers; this.categorizationAnalyzer = instance.categorizationAnalyzer; this.categorizationFieldName = instance.categorizationFieldName; this.categorizationFilters = instance.categorizationFilters; - this.detectors = instance.detectors; - this.influencers = instance.influencers; - this.modelPruneWindow = instance.modelPruneWindow; this.latency = instance.latency; + this.modelPruneWindow = instance.modelPruneWindow; this.multivariateByFields = instance.multivariateByFields; this.perPartitionCategorization = instance.perPartitionCategorization; this.summaryCountFieldName = instance.summaryCountFieldName; @@ -397,7 +422,11 @@ private Builder(AnalysisConfigRead instance) { } /** * Required - The size of the interval that the analysis is aggregated into, - * typically between 5m and 1h. + * typically between 5m and 1h. This value should be + * either a whole number of days or equate to a whole number of buckets in one + * day. If the anomaly detection job uses a datafeed with aggregations, this + * value must also be divisible by the interval of the date histogram + * aggregation. *

    * API name: {@code bucket_span} */ @@ -408,7 +437,11 @@ public final Builder bucketSpan(Time value) { /** * Required - The size of the interval that the analysis is aggregated into, - * typically between 5m and 1h. + * typically between 5m and 1h. This value should be + * either a whole number of days or equate to a whole number of buckets in one + * day. If the anomaly detection job uses a datafeed with aggregations, this + * value must also be divisible by the interval of the date histogram + * aggregation. *

    * API name: {@code bucket_span} */ @@ -416,13 +449,93 @@ public final Builder bucketSpan(Function> fn) return this.bucketSpan(fn.apply(new Time.Builder()).build()); } + /** + * Required - Detector configuration objects specify which data fields a job + * analyzes. They also specify which analytical functions are used. You can + * specify multiple detectors for a job. If the detectors array does not contain + * at least one detector, no analysis can occur and an error is returned. + *

    + * API name: {@code detectors} + *

    + * Adds all elements of list to detectors. + */ + public final Builder detectors(List list) { + this.detectors = _listAddAll(this.detectors, list); + return this; + } + + /** + * Required - Detector configuration objects specify which data fields a job + * analyzes. They also specify which analytical functions are used. You can + * specify multiple detectors for a job. If the detectors array does not contain + * at least one detector, no analysis can occur and an error is returned. + *

    + * API name: {@code detectors} + *

    + * Adds one or more values to detectors. + */ + public final Builder detectors(DetectorRead value, DetectorRead... values) { + this.detectors = _listAdd(this.detectors, value, values); + return this; + } + + /** + * Required - Detector configuration objects specify which data fields a job + * analyzes. They also specify which analytical functions are used. You can + * specify multiple detectors for a job. If the detectors array does not contain + * at least one detector, no analysis can occur and an error is returned. + *

    + * API name: {@code detectors} + *

    + * Adds a value to detectors using a builder lambda. + */ + public final Builder detectors(Function> fn) { + return detectors(fn.apply(new DetectorRead.Builder()).build()); + } + + /** + * Required - A comma separated list of influencer field names. Typically these + * can be the by, over, or partition fields that are used in the detector + * configuration. You might also want to use a field name that is not + * specifically named in a detector, but is available as part of the input data. + * When you use multiple detectors, the use of influencers is recommended as it + * aggregates results for each influencer entity. + *

    + * API name: {@code influencers} + *

    + * Adds all elements of list to influencers. + */ + public final Builder influencers(List list) { + this.influencers = _listAddAll(this.influencers, list); + return this; + } + + /** + * Required - A comma separated list of influencer field names. Typically these + * can be the by, over, or partition fields that are used in the detector + * configuration. You might also want to use a field name that is not + * specifically named in a detector, but is available as part of the input data. + * When you use multiple detectors, the use of influencers is recommended as it + * aggregates results for each influencer entity. + *

    + * API name: {@code influencers} + *

    + * Adds one or more values to influencers. + */ + public final Builder influencers(String value, String... values) { + this.influencers = _listAdd(this.influencers, value, values); + return this; + } + /** * If categorization_field_name is specified, you can also define * the analyzer that is used to interpret the categorization field. This * property cannot be used at the same time as * categorization_filters. The categorization analyzer specifies * how the categorization_field is interpreted by the - * categorization process. + * categorization process. The categorization_analyzer field can be + * specified either as a string or as an object. If it is a string, it must + * refer to a built-in analyzer or one added by another plugin. *

    * API name: {@code categorization_analyzer} */ @@ -437,7 +550,9 @@ public final Builder categorizationAnalyzer(@Nullable CategorizationAnalyzer val * property cannot be used at the same time as * categorization_filters. The categorization analyzer specifies * how the categorization_field is interpreted by the - * categorization process. + * categorization process. The categorization_analyzer field can be + * specified either as a string or as an object. If it is a string, it must + * refer to a built-in analyzer or one added by another plugin. *

    * API name: {@code categorization_analyzer} */ @@ -463,7 +578,16 @@ public final Builder categorizationFieldName(@Nullable String value) { * If categorization_field_name is specified, you can also define * optional filters. This property expects an array of regular expressions. The * expressions are used to filter out matching sequences from the categorization - * field values. + * field values. You can use this functionality to fine tune the categorization + * by excluding sequences from consideration when categories are defined. For + * example, you can exclude SQL statements that appear in your log files. This + * property cannot be used at the same time as + * categorization_analyzer. If you only want to define simple + * regular expression filters that are applied prior to tokenization, setting + * this property is the easiest method. If you also want to customize the + * tokenizer or post-tokenization filtering, use the + * categorization_analyzer property instead and include the filters + * as pattern_replace character filters. The effect is exactly the same. *

    * API name: {@code categorization_filters} *

    @@ -478,7 +602,16 @@ public final Builder categorizationFilters(List list) { * If categorization_field_name is specified, you can also define * optional filters. This property expects an array of regular expressions. The * expressions are used to filter out matching sequences from the categorization - * field values. + * field values. You can use this functionality to fine tune the categorization + * by excluding sequences from consideration when categories are defined. For + * example, you can exclude SQL statements that appear in your log files. This + * property cannot be used at the same time as + * categorization_analyzer. If you only want to define simple + * regular expression filters that are applied prior to tokenization, setting + * this property is the easiest method. If you also want to customize the + * tokenizer or post-tokenization filtering, use the + * categorization_analyzer property instead and include the filters + * as pattern_replace character filters. The effect is exactly the same. *

    * API name: {@code categorization_filters} *

    @@ -490,87 +623,35 @@ public final Builder categorizationFilters(String value, String... values) { } /** - * Required - An array of detector configuration objects. Detector configuration - * objects specify which data fields a job analyzes. They also specify which - * analytical functions are used. You can specify multiple detectors for a job. - *

    - * API name: {@code detectors} - *

    - * Adds all elements of list to detectors. - */ - public final Builder detectors(List list) { - this.detectors = _listAddAll(this.detectors, list); - return this; - } - - /** - * Required - An array of detector configuration objects. Detector configuration - * objects specify which data fields a job analyzes. They also specify which - * analytical functions are used. You can specify multiple detectors for a job. - *

    - * API name: {@code detectors} - *

    - * Adds one or more values to detectors. - */ - public final Builder detectors(DetectorRead value, DetectorRead... values) { - this.detectors = _listAdd(this.detectors, value, values); - return this; - } - - /** - * Required - An array of detector configuration objects. Detector configuration - * objects specify which data fields a job analyzes. They also specify which - * analytical functions are used. You can specify multiple detectors for a job. - *

    - * API name: {@code detectors} - *

    - * Adds a value to detectors using a builder lambda. - */ - public final Builder detectors(Function> fn) { - return detectors(fn.apply(new DetectorRead.Builder()).build()); - } - - /** - * Required - A comma separated list of influencer field names. Typically these - * can be the by, over, or partition fields that are used in the detector - * configuration. You might also want to use a field name that is not - * specifically named in a detector, but is available as part of the input data. - * When you use multiple detectors, the use of influencers is recommended as it - * aggregates results for each influencer entity. - *

    - * API name: {@code influencers} + * The size of the window in which to expect data that is out of time order. If + * you specify a non-zero value, it must be greater than or equal to one second. + * NOTE: Latency is applicable only when you send data by using the post data + * API. *

    - * Adds all elements of list to influencers. + * API name: {@code latency} */ - public final Builder influencers(List list) { - this.influencers = _listAddAll(this.influencers, list); + public final Builder latency(@Nullable Time value) { + this.latency = value; return this; } /** - * Required - A comma separated list of influencer field names. Typically these - * can be the by, over, or partition fields that are used in the detector - * configuration. You might also want to use a field name that is not - * specifically named in a detector, but is available as part of the input data. - * When you use multiple detectors, the use of influencers is recommended as it - * aggregates results for each influencer entity. + * The size of the window in which to expect data that is out of time order. If + * you specify a non-zero value, it must be greater than or equal to one second. + * NOTE: Latency is applicable only when you send data by using the post data + * API. *

    - * API name: {@code influencers} - *

    - * Adds one or more values to influencers. + * API name: {@code latency} */ - public final Builder influencers(String value, String... values) { - this.influencers = _listAdd(this.influencers, value, values); - return this; + public final Builder latency(Function> fn) { + return this.latency(fn.apply(new Time.Builder()).build()); } /** * Advanced configuration option. Affects the pruning of models that have not * been updated for the given time duration. The value must be set to a multiple * of the bucket_span. If set too low, important information may be - * removed from the model. Typically, set to 30d or longer. If not - * set, model pruning only occurs if the model memory status reaches the soft - * limit or the hard limit. For jobs created in 8.1 and later, the default value + * removed from the model. For jobs created in 8.1 and later, the default value * is the greater of 30d or 20 times bucket_span. *

    * API name: {@code model_prune_window} @@ -584,9 +665,7 @@ public final Builder modelPruneWindow(@Nullable Time value) { * Advanced configuration option. Affects the pruning of models that have not * been updated for the given time duration. The value must be set to a multiple * of the bucket_span. If set too low, important information may be - * removed from the model. Typically, set to 30d or longer. If not - * set, model pruning only occurs if the model memory status reaches the soft - * limit or the hard limit. For jobs created in 8.1 and later, the default value + * removed from the model. For jobs created in 8.1 and later, the default value * is the greater of 30d or 20 times bucket_span. *

    * API name: {@code model_prune_window} @@ -595,35 +674,20 @@ public final Builder modelPruneWindow(Function return this.modelPruneWindow(fn.apply(new Time.Builder()).build()); } - /** - * The size of the window in which to expect data that is out of time order. - * Defaults to no latency. If you specify a non-zero value, it must be greater - * than or equal to one second. - *

    - * API name: {@code latency} - */ - public final Builder latency(@Nullable Time value) { - this.latency = value; - return this; - } - - /** - * The size of the window in which to expect data that is out of time order. - * Defaults to no latency. If you specify a non-zero value, it must be greater - * than or equal to one second. - *

    - * API name: {@code latency} - */ - public final Builder latency(Function> fn) { - return this.latency(fn.apply(new Time.Builder()).build()); - } - /** * This functionality is reserved for internal use. It is not supported for use * in customer environments and is not subject to the support SLA of official GA * features. If set to true, the analysis will automatically find * correlations between metrics for a given by field value and report anomalies - * when those correlations cease to hold. + * when those correlations cease to hold. For example, suppose CPU and memory + * usage on host A is usually highly correlated with the same metrics on host B. + * Perhaps this correlation occurs because they are running a load-balanced + * application. If you enable this property, anomalies will be reported when, + * for example, CPU usage on host A is high and the value of CPU usage on host B + * is low. That is to say, you’ll see an anomaly when the CPU of host A is + * unusual given the CPU of host B. To use the + * multivariate_by_fields property, you must also specify + * by_field_name in your detector. *

    * API name: {@code multivariate_by_fields} */ @@ -657,6 +721,8 @@ public final Builder perPartitionCategorization( * be pre-summarized. This property value is the name of the field that contains * the count of raw data points that have been summarized. The same * summary_count_field_name applies to all detectors in the job. + * NOTE: The summary_count_field_name property cannot be used with + * the metric function. *

    * API name: {@code summary_count_field_name} */ @@ -700,15 +766,15 @@ public Builder rebuild() { protected static void setupAnalysisConfigReadDeserializer(ObjectDeserializer op) { op.add(Builder::bucketSpan, Time._DESERIALIZER, "bucket_span"); + op.add(Builder::detectors, JsonpDeserializer.arrayDeserializer(DetectorRead._DESERIALIZER), "detectors"); + op.add(Builder::influencers, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "influencers"); op.add(Builder::categorizationAnalyzer, CategorizationAnalyzer._DESERIALIZER, "categorization_analyzer"); op.add(Builder::categorizationFieldName, JsonpDeserializer.stringDeserializer(), "categorization_field_name"); op.add(Builder::categorizationFilters, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "categorization_filters"); - op.add(Builder::detectors, JsonpDeserializer.arrayDeserializer(DetectorRead._DESERIALIZER), "detectors"); - op.add(Builder::influencers, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "influencers"); - op.add(Builder::modelPruneWindow, Time._DESERIALIZER, "model_prune_window"); op.add(Builder::latency, Time._DESERIALIZER, "latency"); + op.add(Builder::modelPruneWindow, Time._DESERIALIZER, "model_prune_window"); op.add(Builder::multivariateByFields, JsonpDeserializer.booleanDeserializer(), "multivariate_by_fields"); op.add(Builder::perPartitionCategorization, PerPartitionCategorization._DESERIALIZER, "per_partition_categorization"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DetectorRead.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DetectorRead.java index 7e68208ce6..1311312026 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DetectorRead.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DetectorRead.java @@ -62,6 +62,8 @@ */ @JsonpDeserializable public class DetectorRead implements JsonpSerializable { + private final String function; + @Nullable private final String byFieldName; @@ -79,8 +81,6 @@ public class DetectorRead implements JsonpSerializable { @Nullable private final String fieldName; - private final String function; - @Nullable private final String overFieldName; @@ -94,13 +94,13 @@ public class DetectorRead implements JsonpSerializable { private DetectorRead(Builder builder) { + this.function = ApiTypeHelper.requireNonNull(builder.function, this, "function"); this.byFieldName = builder.byFieldName; this.customRules = ApiTypeHelper.unmodifiable(builder.customRules); this.detectorDescription = builder.detectorDescription; this.detectorIndex = builder.detectorIndex; this.excludeFrequent = builder.excludeFrequent; this.fieldName = builder.fieldName; - this.function = ApiTypeHelper.requireNonNull(builder.function, this, "function"); this.overFieldName = builder.overFieldName; this.partitionFieldName = builder.partitionFieldName; this.useNull = builder.useNull; @@ -111,6 +111,17 @@ public static DetectorRead of(Function> fn) return fn.apply(new Builder()).build(); } + /** + * Required - The analysis function that is used. For example, + * count, rare, mean, min, + * max, or sum. + *

    + * API name: {@code function} + */ + public final String function() { + return this.function; + } + /** * The field used to split the data. In particular, this property is used for * analyzing the splits with respect to their own history. It is used for @@ -124,10 +135,9 @@ public final String byFieldName() { } /** - * An array of custom rule objects, which enable you to customize the way - * detectors operate. For example, a rule may dictate to the detector conditions - * under which results should be skipped. Kibana refers to custom rules as job - * rules. + * Custom rules enable you to customize the way detectors operate. For example, + * a rule may dictate conditions under which results should be skipped. Kibana + * refers to custom rules as job rules. *

    * API name: {@code custom_rules} */ @@ -147,7 +157,8 @@ public final String detectorDescription() { /** * A unique identifier for the detector. This identifier is based on the order - * of the detectors in the analysis_config, starting at zero. + * of the detectors in the analysis_config, starting at zero. If + * you specify a value for this property, it is ignored. *

    * API name: {@code detector_index} */ @@ -157,12 +168,11 @@ public final Integer detectorIndex() { } /** - * Contains one of the following values: all, none, - * by, or over. If set, frequent entities are excluded - * from influencing the anomaly results. Entities can be considered frequent - * over time or frequent in a population. If you are working with both over and - * by fields, then you can set exclude_frequent to all for both - * fields, or to by or over for those specific fields. + * If set, frequent entities are excluded from influencing the anomaly results. + * Entities can be considered frequent over time or frequent in a population. If + * you are working with both over and by fields, you can set + * exclude_frequent to all for both fields, or to + * by or over for those specific fields. *

    * API name: {@code exclude_frequent} */ @@ -173,8 +183,8 @@ public final ExcludeFrequent excludeFrequent() { /** * The field that the detector uses in the function. If you use an event rate - * function such as count or rare, do not specify this - * field. + * function such as count or rare, do not specify this field. The + * field_name cannot contain double quotes or backslashes. *

    * API name: {@code field_name} */ @@ -183,17 +193,6 @@ public final String fieldName() { return this.fieldName; } - /** - * Required - The analysis function that is used. For example, - * count, rare, mean, min, - * max, and sum. - *

    - * API name: {@code function} - */ - public final String function() { - return this.function; - } - /** * The field used to split the data. In particular, this property is used for * analyzing the splits with respect to the history of all splits. It is used @@ -239,6 +238,9 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("function"); + generator.write(this.function); + if (this.byFieldName != null) { generator.writeKey("by_field_name"); generator.write(this.byFieldName); @@ -273,9 +275,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.fieldName); } - generator.writeKey("function"); - generator.write(this.function); - if (this.overFieldName != null) { generator.writeKey("over_field_name"); generator.write(this.overFieldName); @@ -306,6 +305,8 @@ public String toString() { */ public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String function; + @Nullable private String byFieldName; @@ -324,8 +325,6 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private String fieldName; - private String function; - @Nullable private String overFieldName; @@ -338,18 +337,30 @@ public static class Builder extends WithJsonObjectBuilderBase implement public Builder() { } private Builder(DetectorRead instance) { + this.function = instance.function; this.byFieldName = instance.byFieldName; this.customRules = instance.customRules; this.detectorDescription = instance.detectorDescription; this.detectorIndex = instance.detectorIndex; this.excludeFrequent = instance.excludeFrequent; this.fieldName = instance.fieldName; - this.function = instance.function; this.overFieldName = instance.overFieldName; this.partitionFieldName = instance.partitionFieldName; this.useNull = instance.useNull; } + /** + * Required - The analysis function that is used. For example, + * count, rare, mean, min, + * max, or sum. + *

    + * API name: {@code function} + */ + public final Builder function(String value) { + this.function = value; + return this; + } + /** * The field used to split the data. In particular, this property is used for * analyzing the splits with respect to their own history. It is used for @@ -363,10 +374,9 @@ public final Builder byFieldName(@Nullable String value) { } /** - * An array of custom rule objects, which enable you to customize the way - * detectors operate. For example, a rule may dictate to the detector conditions - * under which results should be skipped. Kibana refers to custom rules as job - * rules. + * Custom rules enable you to customize the way detectors operate. For example, + * a rule may dictate conditions under which results should be skipped. Kibana + * refers to custom rules as job rules. *

    * API name: {@code custom_rules} *

    @@ -378,10 +388,9 @@ public final Builder customRules(List list) { } /** - * An array of custom rule objects, which enable you to customize the way - * detectors operate. For example, a rule may dictate to the detector conditions - * under which results should be skipped. Kibana refers to custom rules as job - * rules. + * Custom rules enable you to customize the way detectors operate. For example, + * a rule may dictate conditions under which results should be skipped. Kibana + * refers to custom rules as job rules. *

    * API name: {@code custom_rules} *

    @@ -393,10 +402,9 @@ public final Builder customRules(DetectionRule value, DetectionRule... values) { } /** - * An array of custom rule objects, which enable you to customize the way - * detectors operate. For example, a rule may dictate to the detector conditions - * under which results should be skipped. Kibana refers to custom rules as job - * rules. + * Custom rules enable you to customize the way detectors operate. For example, + * a rule may dictate conditions under which results should be skipped. Kibana + * refers to custom rules as job rules. *

    * API name: {@code custom_rules} *

    @@ -418,7 +426,8 @@ public final Builder detectorDescription(@Nullable String value) { /** * A unique identifier for the detector. This identifier is based on the order - * of the detectors in the analysis_config, starting at zero. + * of the detectors in the analysis_config, starting at zero. If + * you specify a value for this property, it is ignored. *

    * API name: {@code detector_index} */ @@ -428,12 +437,11 @@ public final Builder detectorIndex(@Nullable Integer value) { } /** - * Contains one of the following values: all, none, - * by, or over. If set, frequent entities are excluded - * from influencing the anomaly results. Entities can be considered frequent - * over time or frequent in a population. If you are working with both over and - * by fields, then you can set exclude_frequent to all for both - * fields, or to by or over for those specific fields. + * If set, frequent entities are excluded from influencing the anomaly results. + * Entities can be considered frequent over time or frequent in a population. If + * you are working with both over and by fields, you can set + * exclude_frequent to all for both fields, or to + * by or over for those specific fields. *

    * API name: {@code exclude_frequent} */ @@ -444,8 +452,8 @@ public final Builder excludeFrequent(@Nullable ExcludeFrequent value) { /** * The field that the detector uses in the function. If you use an event rate - * function such as count or rare, do not specify this - * field. + * function such as count or rare, do not specify this field. The + * field_name cannot contain double quotes or backslashes. *

    * API name: {@code field_name} */ @@ -454,18 +462,6 @@ public final Builder fieldName(@Nullable String value) { return this; } - /** - * Required - The analysis function that is used. For example, - * count, rare, mean, min, - * max, and sum. - *

    - * API name: {@code function} - */ - public final Builder function(String value) { - this.function = value; - return this; - } - /** * The field used to split the data. In particular, this property is used for * analyzing the splits with respect to the history of all splits. It is used @@ -534,13 +530,13 @@ public Builder rebuild() { protected static void setupDetectorReadDeserializer(ObjectDeserializer op) { + op.add(Builder::function, JsonpDeserializer.stringDeserializer(), "function"); op.add(Builder::byFieldName, JsonpDeserializer.stringDeserializer(), "by_field_name"); op.add(Builder::customRules, JsonpDeserializer.arrayDeserializer(DetectionRule._DESERIALIZER), "custom_rules"); op.add(Builder::detectorDescription, JsonpDeserializer.stringDeserializer(), "detector_description"); op.add(Builder::detectorIndex, JsonpDeserializer.integerDeserializer(), "detector_index"); op.add(Builder::excludeFrequent, ExcludeFrequent._DESERIALIZER, "exclude_frequent"); op.add(Builder::fieldName, JsonpDeserializer.stringDeserializer(), "field_name"); - op.add(Builder::function, JsonpDeserializer.stringDeserializer(), "function"); op.add(Builder::overFieldName, JsonpDeserializer.stringDeserializer(), "over_field_name"); op.add(Builder::partitionFieldName, JsonpDeserializer.stringDeserializer(), "partition_field_name"); op.add(Builder::useNull, JsonpDeserializer.booleanDeserializer(), "use_null"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java index 6f24d2ee7c..e815d65f33 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java @@ -3478,9 +3478,7 @@ public CompletableFuture validate() { /** * Validate an anomaly detection job. * - * @see Documentation on - * elastic.co + * @see Documentation on elastic.co */ public CompletableFuture validateDetector(ValidateDetectorRequest request) { @@ -3496,9 +3494,7 @@ public CompletableFuture validateDetector(ValidateDete * @param fn * a function that initializes a builder to create the * {@link ValidateDetectorRequest} - * @see Documentation on - * elastic.co + * @see Documentation on elastic.co */ public final CompletableFuture validateDetector( @@ -3509,9 +3505,7 @@ public final CompletableFuture validateDetector( /** * Validate an anomaly detection job. * - * @see Documentation on - * elastic.co + * @see Documentation on elastic.co */ public CompletableFuture validateDetector() { diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java index 0dbd07d3b4..19eff5674a 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java @@ -3567,9 +3567,7 @@ public ValidateResponse validate() throws IOException, ElasticsearchException { /** * Validate an anomaly detection job. * - * @see Documentation on - * elastic.co + * @see Documentation on elastic.co */ public ValidateDetectorResponse validateDetector(ValidateDetectorRequest request) @@ -3586,9 +3584,7 @@ public ValidateDetectorResponse validateDetector(ValidateDetectorRequest request * @param fn * a function that initializes a builder to create the * {@link ValidateDetectorRequest} - * @see Documentation on - * elastic.co + * @see Documentation on elastic.co */ public final ValidateDetectorResponse validateDetector( @@ -3600,9 +3596,7 @@ public final ValidateDetectorResponse validateDetector( /** * Validate an anomaly detection job. * - * @see Documentation on - * elastic.co + * @see Documentation on elastic.co */ public ValidateDetectorResponse validateDetector() throws IOException, ElasticsearchException { diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/QueryRuleCriteriaType.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/QueryRuleCriteriaType.java index 8c8de04782..7e6e761c30 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/QueryRuleCriteriaType.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/QueryRuleCriteriaType.java @@ -50,8 +50,6 @@ public enum QueryRuleCriteriaType implements JsonEnum { Exact("exact"), - ExactFuzzy("exact_fuzzy"), - Fuzzy("fuzzy"), Prefix("prefix"), diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/searchable_snapshots/CacheStatsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/searchable_snapshots/CacheStatsRequest.java index e28caeb41d..47bc7b0fd0 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/searchable_snapshots/CacheStatsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/searchable_snapshots/CacheStatsRequest.java @@ -21,7 +21,6 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -32,6 +31,7 @@ import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.String; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -68,16 +68,12 @@ */ public class CacheStatsRequest extends RequestBase { - @Nullable - private final Time masterTimeout; - private final List nodeId; // --------------------------------------------------------------------------------------------- private CacheStatsRequest(Builder builder) { - this.masterTimeout = builder.masterTimeout; this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); } @@ -86,14 +82,6 @@ public static CacheStatsRequest of(Function @@ -112,34 +100,15 @@ public final List nodeId() { public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Time masterTimeout; - @Nullable private List nodeId; public Builder() { } private Builder(CacheStatsRequest instance) { - this.masterTimeout = instance.masterTimeout; this.nodeId = instance.nodeId; } - /** - * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - /** * The names of the nodes in the cluster to target. *

    @@ -252,11 +221,7 @@ public Builder rebuild() { // Request parameters request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - return params; + return Collections.emptyMap(); }, SimpleEndpoint.emptyMap(), false, CacheStatsResponse._DESERIALIZER); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptorRead.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptorRead.java index 0c4297645e..bcd6f0aaba 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptorRead.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptorRead.java @@ -179,7 +179,10 @@ public final Map metadata() { } /** - * A list of users that the API keys can impersonate. + * A list of users that the API keys can impersonate. NOTE: In Elastic Cloud + * Serverless, the run-as feature is disabled. For API compatibility, you can + * still specify an empty run_as field, but a non-empty list will + * be rejected. *

    * API name: {@code run_as} */ @@ -188,7 +191,7 @@ public final List runAs() { } /** - * An optional description of the role descriptor. + * Optional description of the role descriptor *

    * API name: {@code description} */ @@ -198,7 +201,7 @@ public final String description() { } /** - * A restriction for when the role descriptor is allowed to be effective. + * Restriction for when the role descriptor is allowed to be effective. *

    * API name: {@code restriction} */ @@ -645,7 +648,10 @@ public final Builder metadata(String key, JsonData value) { } /** - * A list of users that the API keys can impersonate. + * A list of users that the API keys can impersonate. NOTE: In Elastic Cloud + * Serverless, the run-as feature is disabled. For API compatibility, you can + * still specify an empty run_as field, but a non-empty list will + * be rejected. *

    * API name: {@code run_as} *

    @@ -657,7 +663,10 @@ public final Builder runAs(List list) { } /** - * A list of users that the API keys can impersonate. + * A list of users that the API keys can impersonate. NOTE: In Elastic Cloud + * Serverless, the run-as feature is disabled. For API compatibility, you can + * still specify an empty run_as field, but a non-empty list will + * be rejected. *

    * API name: {@code run_as} *

    @@ -669,7 +678,7 @@ public final Builder runAs(String value, String... values) { } /** - * An optional description of the role descriptor. + * Optional description of the role descriptor *

    * API name: {@code description} */ @@ -679,7 +688,7 @@ public final Builder description(@Nullable String value) { } /** - * A restriction for when the role descriptor is allowed to be effective. + * Restriction for when the role descriptor is allowed to be effective. *

    * API name: {@code restriction} */ @@ -689,7 +698,7 @@ public final Builder restriction(@Nullable Restriction value) { } /** - * A restriction for when the role descriptor is allowed to be effective. + * Restriction for when the role descriptor is allowed to be effective. *

    * API name: {@code restriction} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/snapshot/GetSnapshotRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/snapshot/GetSnapshotRequest.java index cc7fb6ea6b..64d31b839f 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/snapshot/GetSnapshotRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/snapshot/GetSnapshotRequest.java @@ -264,7 +264,7 @@ public final String repository() { } /** - * The maximum number of snapshots to return. The default is 0, which means to + * The maximum number of snapshots to return. The default is -1, which means to * return all that match the request without limit. *

    * API name: {@code size} @@ -554,7 +554,7 @@ public final Builder repository(String value) { } /** - * The maximum number of snapshots to return. The default is 0, which means to + * The maximum number of snapshots to return. The default is -1, which means to * return all that match the request without limit. *

    * API name: {@code size} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java index 7db4750907..96fb534a77 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java @@ -306,8 +306,7 @@ public CompletableFuture getSynonymsSets() { /** * Create or update a synonym set. *

    - * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. If - * you need to manage more synonym rules, you can create multiple synonym sets. + * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. *

    * When an existing synonyms set is updated, the search analyzers that use the * synonyms set are reloaded automatically for all indices. This is equivalent @@ -332,8 +331,7 @@ public CompletableFuture putSynonym(PutSynonymRequest reques /** * Create or update a synonym set. *

    - * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. If - * you need to manage more synonym rules, you can create multiple synonym sets. + * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. *

    * When an existing synonyms set is updated, the search analyzers that use the * synonyms set are reloaded automatically for all indices. This is equivalent diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java index a570af6f55..0077d4f5db 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java @@ -312,8 +312,7 @@ public GetSynonymsSetsResponse getSynonymsSets() throws IOException, Elasticsear /** * Create or update a synonym set. *

    - * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. If - * you need to manage more synonym rules, you can create multiple synonym sets. + * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. *

    * When an existing synonyms set is updated, the search analyzers that use the * synonyms set are reloaded automatically for all indices. This is equivalent @@ -338,8 +337,7 @@ public PutSynonymResponse putSynonym(PutSynonymRequest request) throws IOExcepti /** * Create or update a synonym set. *

    - * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. If - * you need to manage more synonym rules, you can create multiple synonym sets. + * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. *

    * When an existing synonyms set is updated, the search analyzers that use the * synonyms set are reloaded automatically for all indices. This is equivalent diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymRequest.java index cd4ef7d060..00396382a1 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymRequest.java @@ -61,8 +61,7 @@ /** * Create or update a synonym set. *

    - * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. If - * you need to manage more synonym rules, you can create multiple synonym sets. + * Synonyms sets are limited to a maximum of 10,000 synonym rules per set. *

    * When an existing synonyms set is updated, the search analyzers that use the * synonyms set are reloaded automatically for all indices. This is equivalent diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/SynonymRuleRead.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/SynonymRuleRead.java index 6b558d94aa..02df89f682 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/SynonymRuleRead.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/synonyms/SynonymRuleRead.java @@ -77,7 +77,9 @@ public static SynonymRuleRead synonymRuleReadOf(Function * API name: {@code id} */ @@ -86,7 +88,7 @@ public final String id() { } /** - * Required - Synonyms, in Solr format, that conform the synonym rule. + * Required - The synonyms that conform the synonym rule in Solr format. *

    * API name: {@code synonyms} */ @@ -153,7 +155,9 @@ public abstract static class AbstractBuilder * API name: {@code id} */ @@ -163,7 +167,7 @@ public final BuilderT id(String value) { } /** - * Required - Synonyms, in Solr format, that conform the synonym rule. + * Required - The synonyms that conform the synonym rule in Solr format. *

    * API name: {@code synonyms} */