Skip to content

Commit

Permalink
fixes-from-pr-2412 (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta authored Feb 20, 2024
1 parent d4baa91 commit 25a65cf
Show file tree
Hide file tree
Showing 22 changed files with 966 additions and 440 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2238,7 +2238,8 @@ public final <TDocument, TPartialDocument> CompletableFuture<UpdateResponse<TDoc
// ----- Endpoint: update_by_query

/**
* Performs an update on every document in the index without changing the
* Updates documents that match the specified query. If no query is specified,
* performs an update on every document in the index without changing the
* source, for example to pick up a mapping change.
*
* @see <a href=
Expand All @@ -2254,7 +2255,8 @@ public CompletableFuture<UpdateByQueryResponse> updateByQuery(UpdateByQueryReque
}

/**
* Performs an update on every document in the index without changing the
* Updates documents that match the specified query. If no query is specified,
* performs an update on every document in the index without changing the
* source, for example to pick up a mapping change.
*
* @param fn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2283,7 +2283,8 @@ public final <TDocument, TPartialDocument> UpdateResponse<TDocument> update(
// ----- Endpoint: update_by_query

/**
* Performs an update on every document in the index without changing the
* Updates documents that match the specified query. If no query is specified,
* performs an update on every document in the index without changing the
* source, for example to pick up a mapping change.
*
* @see <a href=
Expand All @@ -2300,7 +2301,8 @@ public UpdateByQueryResponse updateByQuery(UpdateByQueryRequest request)
}

/**
* Performs an update on every document in the index without changing the
* Updates documents that match the specified query. If no query is specified,
* performs an update on every document in the index without changing the
* source, for example to pick up a mapping change.
*
* @param fn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* specification</a>
*/
@JsonpDeserializable
public class IcuTokenizer extends TokenizerBase implements TokenizerDefinitionVariant, TokenFilterDefinitionVariant {
public class IcuTokenizer extends TokenizerBase implements TokenizerDefinitionVariant {
private final String ruleFiles;

// ---------------------------------------------------------------------------------------------
Expand All @@ -79,14 +79,6 @@ public TokenizerDefinition.Kind _tokenizerDefinitionKind() {
return TokenizerDefinition.Kind.IcuTokenizer;
}

/**
* TokenFilterDefinition variant kind.
*/
@Override
public TokenFilterDefinition.Kind _tokenFilterDefinitionKind() {
return TokenFilterDefinition.Kind.IcuTokenizer;
}

/**
* Required - API name: {@code rule_files}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ public enum Kind implements JsonEnum {

IcuNormalizer("icu_normalizer"),

IcuTokenizer("icu_tokenizer"),

IcuTransform("icu_transform"),

Kstem("kstem"),
Expand Down Expand Up @@ -454,23 +452,6 @@ public IcuNormalizationTokenFilter icuNormalizer() {
return TaggedUnionUtils.get(this, Kind.IcuNormalizer);
}

/**
* Is this variant instance of kind {@code icu_tokenizer}?
*/
public boolean isIcuTokenizer() {
return _kind == Kind.IcuTokenizer;
}

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

/**
* Is this variant instance of kind {@code icu_transform}?
*/
Expand Down Expand Up @@ -1254,17 +1235,6 @@ public ObjectBuilder<TokenFilterDefinition> icuNormalizer(
return this.icuNormalizer(fn.apply(new IcuNormalizationTokenFilter.Builder()).build());
}

public ObjectBuilder<TokenFilterDefinition> icuTokenizer(IcuTokenizer v) {
this._kind = Kind.IcuTokenizer;
this._value = v;
return this;
}

public ObjectBuilder<TokenFilterDefinition> icuTokenizer(
Function<IcuTokenizer.Builder, ObjectBuilder<IcuTokenizer>> fn) {
return this.icuTokenizer(fn.apply(new IcuTokenizer.Builder()).build());
}

public ObjectBuilder<TokenFilterDefinition> icuTransform(IcuTransformTokenFilter v) {
this._kind = Kind.IcuTransform;
this._value = v;
Expand Down Expand Up @@ -1679,7 +1649,6 @@ protected static void setupTokenFilterDefinitionDeserializer(ObjectDeserializer<
op.add(Builder::icuCollation, IcuCollationTokenFilter._DESERIALIZER, "icu_collation");
op.add(Builder::icuFolding, IcuFoldingTokenFilter._DESERIALIZER, "icu_folding");
op.add(Builder::icuNormalizer, IcuNormalizationTokenFilter._DESERIALIZER, "icu_normalizer");
op.add(Builder::icuTokenizer, IcuTokenizer._DESERIALIZER, "icu_tokenizer");
op.add(Builder::icuTransform, IcuTransformTokenFilter._DESERIALIZER, "icu_transform");
op.add(Builder::kstem, KStemTokenFilter._DESERIALIZER, "kstem");
op.add(Builder::keepTypes, KeepTypesTokenFilter._DESERIALIZER, "keep_types");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,24 +293,6 @@ public static TokenFilterDefinition icuNormalizer(
return builder.build();
}

/**
* Creates a builder for the {@link IcuTokenizer icu_tokenizer}
* {@code TokenFilterDefinition} variant.
*/
public static IcuTokenizer.Builder icuTokenizer() {
return new IcuTokenizer.Builder();
}

/**
* Creates a TokenFilterDefinition of the {@link IcuTokenizer icu_tokenizer}
* {@code TokenFilterDefinition} variant.
*/
public static TokenFilterDefinition icuTokenizer(Function<IcuTokenizer.Builder, ObjectBuilder<IcuTokenizer>> fn) {
TokenFilterDefinition.Builder builder = new TokenFilterDefinition.Builder();
builder.icuTokenizer(fn.apply(new IcuTokenizer.Builder()).build());
return builder.build();
}

/**
* Creates a builder for the {@link IcuTransformTokenFilter icu_transform}
* {@code TokenFilterDefinition} variant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public class FieldCapsRequest extends RequestBase implements JsonpSerializable {
@Nullable
private final Boolean ignoreUnavailable;

@Nullable
private final Boolean includeEmptyFields;

@Nullable
private final Boolean includeUnmapped;

Expand All @@ -108,6 +111,7 @@ private FieldCapsRequest(Builder builder) {
this.fields = ApiTypeHelper.unmodifiable(builder.fields);
this.filters = builder.filters;
this.ignoreUnavailable = builder.ignoreUnavailable;
this.includeEmptyFields = builder.includeEmptyFields;
this.includeUnmapped = builder.includeUnmapped;
this.index = ApiTypeHelper.unmodifiable(builder.index);
this.indexFilter = builder.indexFilter;
Expand Down Expand Up @@ -178,6 +182,16 @@ public final Boolean ignoreUnavailable() {
return this.ignoreUnavailable;
}

/**
* If false, empty fields are not included in the response.
* <p>
* API name: {@code include_empty_fields}
*/
@Nullable
public final Boolean includeEmptyFields() {
return this.includeEmptyFields;
}

/**
* If true, unmapped fields are included in the response.
* <p>
Expand Down Expand Up @@ -294,6 +308,9 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder>
@Nullable
private Boolean ignoreUnavailable;

@Nullable
private Boolean includeEmptyFields;

@Nullable
private Boolean includeUnmapped;

Expand Down Expand Up @@ -401,6 +418,16 @@ public final Builder ignoreUnavailable(@Nullable Boolean value) {
return this;
}

/**
* If false, empty fields are not included in the response.
* <p>
* API name: {@code include_empty_fields}
*/
public final Builder includeEmptyFields(@Nullable Boolean value) {
this.includeEmptyFields = value;
return this;
}

/**
* If true, unmapped fields are included in the response.
* <p>
Expand Down Expand Up @@ -634,6 +661,9 @@ protected static void setupFieldCapsRequestDeserializer(ObjectDeserializer<Field
if (request.allowNoIndices != null) {
params.put("allow_no_indices", String.valueOf(request.allowNoIndices));
}
if (request.includeEmptyFields != null) {
params.put("include_empty_fields", String.valueOf(request.includeEmptyFields));
}
if (request.filters != null) {
params.put("filters", request.filters);
}
Expand Down
Loading

0 comments on commit 25a65cf

Please sign in to comment.