Skip to content

Commit

Permalink
Add "mappings" field to IndexSettings object
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Lukyanovich <ilya.lukyanovich@dataart.com>
  • Loading branch information
L00kian committed Mar 1, 2023
1 parent 75c5e59 commit 9a9e9a4
Show file tree
Hide file tree
Showing 4 changed files with 559 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ public class IndexSettings implements JsonpSerializable {
@Nullable
private final IndexSettings settings;

@Nullable
private final IndexSettingsMapping mapping;

// ---------------------------------------------------------------------------------------------

private IndexSettings(Builder builder) {
Expand Down Expand Up @@ -278,6 +281,7 @@ private IndexSettings(Builder builder) {
this.topMetricsMaxSize = builder.topMetricsMaxSize;
this.analysis = builder.analysis;
this.settings = builder.settings;
this.mapping = builder.mapping;

}

Expand Down Expand Up @@ -724,6 +728,14 @@ public final IndexSettings settings() {
return this.settings;
}

/**
* API name: {@code mapping}
*/
@Nullable
public final IndexSettingsMapping mapping() {
return this.mapping;
}

/**
* Serialize this object to JSON.
*/
Expand Down Expand Up @@ -1015,6 +1027,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.settings.serialize(generator, mapper);

}
if (this.mapping != null) {
generator.writeKey("mapping");
this.mapping.serialize(generator, mapper);

}

}

Expand Down Expand Up @@ -1190,6 +1207,9 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder<I
@Nullable
private IndexSettings settings;

@Nullable
private IndexSettingsMapping mapping;

/**
* API name: {@code index}
*/
Expand Down Expand Up @@ -1727,6 +1747,21 @@ public final Builder settings(Function<IndexSettings.Builder, ObjectBuilder<Inde
return this.settings(fn.apply(new IndexSettings.Builder()).build());
}

/**
* API name: {@code mapping}
*/
public final Builder mapping(@Nullable IndexSettingsMapping value) {
this.mapping = value;
return this;
}

/**
* API name: {@code mapping}
*/
public final Builder mapping(Function<IndexSettingsMapping.Builder, ObjectBuilder<IndexSettingsMapping>> fn) {
return this.mapping(fn.apply(new IndexSettingsMapping.Builder()).build());
}

/**
* Builds a {@link IndexSettings}.
*
Expand Down Expand Up @@ -1838,6 +1873,7 @@ protected static void setupIndexSettingsDeserializer(ObjectDeserializer<IndexSet
op.add(Builder::topMetricsMaxSize, JsonpDeserializer.integerDeserializer(), "top_metrics_max_size");
op.add(Builder::analysis, IndexSettingsAnalysis._DESERIALIZER, "analysis", "index.analysis");
op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings");
op.add(Builder::mapping, IndexSettingsMapping._DESERIALIZER, "mapping");

}

Expand Down
Loading

0 comments on commit 9a9e9a4

Please sign in to comment.