diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NGramTokenizer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NGramTokenizer.java index d7b874c81..182048458 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NGramTokenizer.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NGramTokenizer.java @@ -62,9 +62,11 @@ public class NGramTokenizer extends TokenizerBase implements TokenizerDefinition @Nullable private final String customTokenChars; - private final int maxGram; + @Nullable + private final Integer maxGram; - private final int minGram; + @Nullable + private final Integer minGram; private final List tokenChars; @@ -74,9 +76,9 @@ private NGramTokenizer(Builder builder) { super(builder); this.customTokenChars = builder.customTokenChars; - this.maxGram = ApiTypeHelper.requireNonNull(builder.maxGram, this, "maxGram"); - this.minGram = ApiTypeHelper.requireNonNull(builder.minGram, this, "minGram"); - this.tokenChars = ApiTypeHelper.unmodifiableRequired(builder.tokenChars, this, "tokenChars"); + this.maxGram = builder.maxGram; + this.minGram = builder.minGram; + this.tokenChars = ApiTypeHelper.unmodifiable(builder.tokenChars); } @@ -101,21 +103,23 @@ public final String customTokenChars() { } /** - * Required - API name: {@code max_gram} + * API name: {@code max_gram} */ - public final int maxGram() { + @Nullable + public final Integer maxGram() { return this.maxGram; } /** - * Required - API name: {@code min_gram} + * API name: {@code min_gram} */ - public final int minGram() { + @Nullable + public final Integer minGram() { return this.minGram; } /** - * Required - API name: {@code token_chars} + * API name: {@code token_chars} */ public final List tokenChars() { return this.tokenChars; @@ -130,12 +134,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.customTokenChars); } - generator.writeKey("max_gram"); - generator.write(this.maxGram); + if (this.maxGram != null) { + generator.writeKey("max_gram"); + generator.write(this.maxGram); - generator.writeKey("min_gram"); - generator.write(this.minGram); + } + if (this.minGram != null) { + generator.writeKey("min_gram"); + generator.write(this.minGram); + } if (ApiTypeHelper.isDefined(this.tokenChars)) { generator.writeKey("token_chars"); generator.writeStartArray(); @@ -160,10 +168,13 @@ public static class Builder extends TokenizerBase.AbstractBuilder @Nullable private String customTokenChars; + @Nullable private Integer maxGram; + @Nullable private Integer minGram; + @Nullable private List tokenChars; /** @@ -175,23 +186,23 @@ public final Builder customTokenChars(@Nullable String value) { } /** - * Required - API name: {@code max_gram} + * API name: {@code max_gram} */ - public final Builder maxGram(int value) { + public final Builder maxGram(@Nullable Integer value) { this.maxGram = value; return this; } /** - * Required - API name: {@code min_gram} + * API name: {@code min_gram} */ - public final Builder minGram(int value) { + public final Builder minGram(@Nullable Integer value) { this.minGram = value; return this; } /** - * Required - API name: {@code token_chars} + * API name: {@code token_chars} *

* Adds all elements of list to tokenChars. */ @@ -201,7 +212,7 @@ public final Builder tokenChars(List list) { } /** - * Required - API name: {@code token_chars} + * API name: {@code token_chars} *

* Adds one or more values to tokenChars. */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 815936f2c..878e21405 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -628,7 +628,7 @@ '_types.analysis.CharFilter': '_types/analysis/char_filters.ts#L28-L30', '_types.analysis.CharFilterBase': '_types/analysis/char_filters.ts#L24-L26', '_types.analysis.CharFilterDefinition': '_types/analysis/char_filters.ts#L32-L41', -'_types.analysis.CharGroupTokenizer': '_types/analysis/tokenizers.ts#L55-L59', +'_types.analysis.CharGroupTokenizer': '_types/analysis/tokenizers.ts#L58-L62', '_types.analysis.CommonGramsTokenFilter': '_types/analysis/token_filters.ts#L174-L180', '_types.analysis.CompoundWordTokenFilterBase': '_types/analysis/token_filters.ts#L43-L51', '_types.analysis.ConditionTokenFilter': '_types/analysis/token_filters.ts#L182-L186', @@ -667,7 +667,7 @@ '_types.analysis.KeepWordsTokenFilter': '_types/analysis/token_filters.ts#L225-L230', '_types.analysis.KeywordAnalyzer': '_types/analysis/analyzers.ts#L47-L50', '_types.analysis.KeywordMarkerTokenFilter': '_types/analysis/token_filters.ts#L232-L238', -'_types.analysis.KeywordTokenizer': '_types/analysis/tokenizers.ts#L61-L64', +'_types.analysis.KeywordTokenizer': '_types/analysis/tokenizers.ts#L64-L67', '_types.analysis.KuromojiAnalyzer': '_types/analysis/kuromoji-plugin.ts#L25-L29', '_types.analysis.KuromojiIterationMarkCharFilter': '_types/analysis/kuromoji-plugin.ts#L31-L35', '_types.analysis.KuromojiPartOfSpeechTokenFilter': '_types/analysis/kuromoji-plugin.ts#L37-L40', @@ -678,26 +678,26 @@ '_types.analysis.Language': '_types/analysis/languages.ts#L20-L55', '_types.analysis.LanguageAnalyzer': '_types/analysis/analyzers.ts#L52-L59', '_types.analysis.LengthTokenFilter': '_types/analysis/token_filters.ts#L244-L248', -'_types.analysis.LetterTokenizer': '_types/analysis/tokenizers.ts#L66-L68', +'_types.analysis.LetterTokenizer': '_types/analysis/tokenizers.ts#L69-L71', '_types.analysis.LimitTokenCountTokenFilter': '_types/analysis/token_filters.ts#L250-L254', '_types.analysis.LowercaseNormalizer': '_types/analysis/normalizers.ts#L26-L28', '_types.analysis.LowercaseTokenFilter': '_types/analysis/token_filters.ts#L256-L259', -'_types.analysis.LowercaseTokenizer': '_types/analysis/tokenizers.ts#L70-L72', +'_types.analysis.LowercaseTokenizer': '_types/analysis/tokenizers.ts#L73-L75', '_types.analysis.MappingCharFilter': '_types/analysis/char_filters.ts#L48-L52', '_types.analysis.MultiplexerTokenFilter': '_types/analysis/token_filters.ts#L261-L265', '_types.analysis.NGramTokenFilter': '_types/analysis/token_filters.ts#L267-L272', -'_types.analysis.NGramTokenizer': '_types/analysis/tokenizers.ts#L38-L44', +'_types.analysis.NGramTokenizer': '_types/analysis/tokenizers.ts#L38-L47', '_types.analysis.NoriAnalyzer': '_types/analysis/analyzers.ts#L66-L72', -'_types.analysis.NoriDecompoundMode': '_types/analysis/tokenizers.ts#L74-L78', +'_types.analysis.NoriDecompoundMode': '_types/analysis/tokenizers.ts#L77-L81', '_types.analysis.NoriPartOfSpeechTokenFilter': '_types/analysis/token_filters.ts#L274-L277', -'_types.analysis.NoriTokenizer': '_types/analysis/tokenizers.ts#L80-L86', +'_types.analysis.NoriTokenizer': '_types/analysis/tokenizers.ts#L83-L89', '_types.analysis.Normalizer': '_types/analysis/normalizers.ts#L20-L24', -'_types.analysis.PathHierarchyTokenizer': '_types/analysis/tokenizers.ts#L88-L95', +'_types.analysis.PathHierarchyTokenizer': '_types/analysis/tokenizers.ts#L91-L98', '_types.analysis.PatternAnalyzer': '_types/analysis/analyzers.ts#L74-L81', '_types.analysis.PatternCaptureTokenFilter': '_types/analysis/token_filters.ts#L279-L283', '_types.analysis.PatternReplaceCharFilter': '_types/analysis/char_filters.ts#L54-L59', '_types.analysis.PatternReplaceTokenFilter': '_types/analysis/token_filters.ts#L285-L291', -'_types.analysis.PatternTokenizer': '_types/analysis/tokenizers.ts#L97-L102', +'_types.analysis.PatternTokenizer': '_types/analysis/tokenizers.ts#L100-L105', '_types.analysis.PhoneticEncoder': '_types/analysis/phonetic-plugin.ts#L23-L36', '_types.analysis.PhoneticLanguage': '_types/analysis/phonetic-plugin.ts#L38-L51', '_types.analysis.PhoneticNameType': '_types/analysis/phonetic-plugin.ts#L53-L57', @@ -713,7 +713,7 @@ '_types.analysis.SnowballLanguage': '_types/analysis/languages.ts#L57-L80', '_types.analysis.SnowballTokenFilter': '_types/analysis/token_filters.ts#L310-L313', '_types.analysis.StandardAnalyzer': '_types/analysis/analyzers.ts#L95-L99', -'_types.analysis.StandardTokenizer': '_types/analysis/tokenizers.ts#L104-L107', +'_types.analysis.StandardTokenizer': '_types/analysis/tokenizers.ts#L107-L110', '_types.analysis.StemmerOverrideTokenFilter': '_types/analysis/token_filters.ts#L315-L319', '_types.analysis.StemmerTokenFilter': '_types/analysis/token_filters.ts#L321-L325', '_types.analysis.StopAnalyzer': '_types/analysis/analyzers.ts#L101-L106', @@ -721,20 +721,20 @@ '_types.analysis.SynonymFormat': '_types/analysis/token_filters.ts#L104-L107', '_types.analysis.SynonymGraphTokenFilter': '_types/analysis/token_filters.ts#L109-L119', '_types.analysis.SynonymTokenFilter': '_types/analysis/token_filters.ts#L121-L131', -'_types.analysis.TokenChar': '_types/analysis/tokenizers.ts#L46-L53', +'_types.analysis.TokenChar': '_types/analysis/tokenizers.ts#L49-L56', '_types.analysis.TokenFilter': '_types/analysis/token_filters.ts#L345-L347', '_types.analysis.TokenFilterBase': '_types/analysis/token_filters.ts#L39-L41', '_types.analysis.TokenFilterDefinition': '_types/analysis/token_filters.ts#L349-L401', -'_types.analysis.Tokenizer': '_types/analysis/tokenizers.ts#L119-L121', +'_types.analysis.Tokenizer': '_types/analysis/tokenizers.ts#L122-L124', '_types.analysis.TokenizerBase': '_types/analysis/tokenizers.ts#L26-L28', -'_types.analysis.TokenizerDefinition': '_types/analysis/tokenizers.ts#L123-L141', +'_types.analysis.TokenizerDefinition': '_types/analysis/tokenizers.ts#L126-L144', '_types.analysis.TrimTokenFilter': '_types/analysis/token_filters.ts#L327-L329', '_types.analysis.TruncateTokenFilter': '_types/analysis/token_filters.ts#L331-L334', -'_types.analysis.UaxEmailUrlTokenizer': '_types/analysis/tokenizers.ts#L109-L112', +'_types.analysis.UaxEmailUrlTokenizer': '_types/analysis/tokenizers.ts#L112-L115', '_types.analysis.UniqueTokenFilter': '_types/analysis/token_filters.ts#L336-L339', '_types.analysis.UppercaseTokenFilter': '_types/analysis/token_filters.ts#L341-L343', '_types.analysis.WhitespaceAnalyzer': '_types/analysis/analyzers.ts#L108-L111', -'_types.analysis.WhitespaceTokenizer': '_types/analysis/tokenizers.ts#L114-L117', +'_types.analysis.WhitespaceTokenizer': '_types/analysis/tokenizers.ts#L117-L120', '_types.analysis.WordDelimiterGraphTokenFilter': '_types/analysis/token_filters.ts#L150-L167', '_types.analysis.WordDelimiterTokenFilter': '_types/analysis/token_filters.ts#L133-L148', '_types.mapping.AggregateMetricDoubleProperty': '_types/mapping/complex.ts#L61-L66', @@ -2876,10 +2876,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/dd79a332a784748acb9fa3a71b6f8c88295219ac/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/1a27080e79e765b656e881871d5d79e939970b95/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification.