Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public class FlattenedProperty extends PropertyBase implements PropertyVariant {
@Nullable
private final String nullValue;

@Nullable
private final PreserveLeafArrays preserveLeafArrays;

@Nullable
private final String similarity;

Expand All @@ -102,6 +105,7 @@ private FlattenedProperty(Builder builder) {
this.index = builder.index;
this.indexOptions = builder.indexOptions;
this.nullValue = builder.nullValue;
this.preserveLeafArrays = builder.preserveLeafArrays;
this.similarity = builder.similarity;
this.splitQueriesOnWhitespace = builder.splitQueriesOnWhitespace;
this.timeSeriesDimensions = ApiTypeHelper.unmodifiable(builder.timeSeriesDimensions);
Expand Down Expand Up @@ -176,6 +180,19 @@ public final String nullValue() {
return this.nullValue;
}

/**
* How leaf arrays are represented in synthetic source. When set to
* <code>lossy</code>, leaf arrays are sorted, de-nulled, and deduplicated in
* the returned synthetic source. When set to <code>exact</code>, leaf arrays
* preserve order, nulls, and duplicates.
* <p>
* API name: {@code preserve_leaf_arrays}
*/
@Nullable
public final PreserveLeafArrays preserveLeafArrays() {
return this.preserveLeafArrays;
}

/**
* API name: {@code similarity}
*/
Expand Down Expand Up @@ -237,6 +254,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write(this.nullValue);

}
if (this.preserveLeafArrays != null) {
generator.writeKey("preserve_leaf_arrays");
this.preserveLeafArrays.serialize(generator, mapper);
}
if (this.similarity != null) {
generator.writeKey("similarity");
generator.write(this.similarity);
Expand Down Expand Up @@ -290,6 +311,9 @@ public static class Builder extends PropertyBase.AbstractBuilder<Builder>
@Nullable
private String nullValue;

@Nullable
private PreserveLeafArrays preserveLeafArrays;

@Nullable
private String similarity;

Expand All @@ -309,6 +333,7 @@ private Builder(FlattenedProperty instance) {
this.index = instance.index;
this.indexOptions = instance.indexOptions;
this.nullValue = instance.nullValue;
this.preserveLeafArrays = instance.preserveLeafArrays;
this.similarity = instance.similarity;
this.splitQueriesOnWhitespace = instance.splitQueriesOnWhitespace;
this.timeSeriesDimensions = instance.timeSeriesDimensions;
Expand Down Expand Up @@ -370,6 +395,19 @@ public final Builder nullValue(@Nullable String value) {
return this;
}

/**
* How leaf arrays are represented in synthetic source. When set to
* <code>lossy</code>, leaf arrays are sorted, de-nulled, and deduplicated in
* the returned synthetic source. When set to <code>exact</code>, leaf arrays
* preserve order, nulls, and duplicates.
* <p>
* API name: {@code preserve_leaf_arrays}
*/
public final Builder preserveLeafArrays(@Nullable PreserveLeafArrays value) {
this.preserveLeafArrays = value;
return this;
}

/**
* API name: {@code similarity}
*/
Expand Down Expand Up @@ -447,6 +485,7 @@ protected static void setupFlattenedPropertyDeserializer(ObjectDeserializer<Flat
op.add(Builder::index, JsonpDeserializer.booleanDeserializer(), "index");
op.add(Builder::indexOptions, IndexOptions._DESERIALIZER, "index_options");
op.add(Builder::nullValue, JsonpDeserializer.stringDeserializer(), "null_value");
op.add(Builder::preserveLeafArrays, PreserveLeafArrays._DESERIALIZER, "preserve_leaf_arrays");
op.add(Builder::similarity, JsonpDeserializer.stringDeserializer(), "similarity");
op.add(Builder::splitQueriesOnWhitespace, JsonpDeserializer.booleanDeserializer(),
"split_queries_on_whitespace");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package co.elastic.clients.elasticsearch._types.mapping;

import co.elastic.clients.json.JsonEnum;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;

//----------------------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------

/**
*
* @see <a href=
* "../../doc-files/api-spec.html#_types.mapping.PreserveLeafArrays">API
* specification</a>
*/
@JsonpDeserializable
public enum PreserveLeafArrays implements JsonEnum {
Lossy("lossy"),

Exact("exact"),

;

private final String jsonValue;

PreserveLeafArrays(String jsonValue) {
this.jsonValue = jsonValue;
}

public String jsonValue() {
return this.jsonValue;
}

public static final JsonEnum.Deserializer<PreserveLeafArrays> _DESERIALIZER = new JsonEnum.Deserializer<>(
PreserveLeafArrays.values());
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public class RuntimeField implements DynamicTemplateVariant, JsonpSerializable {
@Nullable
private final Script script;

@Nullable
private final OnScriptError onScriptError;

private final RuntimeFieldType type;

// ---------------------------------------------------------------------------------------------
Expand All @@ -94,6 +97,7 @@ private RuntimeField(Builder builder) {
this.targetField = builder.targetField;
this.targetIndex = builder.targetIndex;
this.script = builder.script;
this.onScriptError = builder.onScriptError;
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");

}
Expand Down Expand Up @@ -178,6 +182,14 @@ public final Script script() {
return this.script;
}

/**
* API name: {@code on_script_error}
*/
@Nullable
public final OnScriptError onScriptError() {
return this.onScriptError;
}

/**
* Required - Field type, which can be: <code>boolean</code>,
* <code>composite</code>, <code>date</code>, <code>double</code>,
Expand Down Expand Up @@ -247,6 +259,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.script.serialize(generator, mapper);

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

Expand Down Expand Up @@ -285,6 +301,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private Script script;

@Nullable
private OnScriptError onScriptError;

private RuntimeFieldType type;

public Builder() {
Expand All @@ -297,6 +316,7 @@ private Builder(RuntimeField instance) {
this.targetField = instance.targetField;
this.targetIndex = instance.targetIndex;
this.script = instance.script;
this.onScriptError = instance.onScriptError;
this.type = instance.type;

}
Expand Down Expand Up @@ -431,6 +451,14 @@ public final Builder script(Function<Script.Builder, ObjectBuilder<Script>> fn)
return this.script(fn.apply(new Script.Builder()).build());
}

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

/**
* Required - Field type, which can be: <code>boolean</code>,
* <code>composite</code>, <code>date</code>, <code>double</code>,
Expand Down Expand Up @@ -486,6 +514,7 @@ protected static void setupRuntimeFieldDeserializer(ObjectDeserializer<RuntimeFi
op.add(Builder::targetField, JsonpDeserializer.stringDeserializer(), "target_field");
op.add(Builder::targetIndex, JsonpDeserializer.stringDeserializer(), "target_index");
op.add(Builder::script, Script._DESERIALIZER, "script");
op.add(Builder::onScriptError, OnScriptError._DESERIALIZER, "on_script_error");
op.add(Builder::type, RuntimeFieldType._DESERIALIZER, "type");

}
Expand Down
Loading
Loading