diff --git a/CHANGELOG.md b/CHANGELOG.md
index 918ee17014..412e7caf71 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased 3.x]
### Added
+- Added BulkIngester helper for efficient bulk operations with buffering, retries, and backpressure. Ported from elasticsearch-java (commit e7120d4) ([#1809](https://github.com/opensearch-project/opensearch-java/pull/1809))
### Dependencies
diff --git a/guides/bulk.md b/guides/bulk.md
index 3c12c2ddc7..8bc5707415 100644
--- a/guides/bulk.md
+++ b/guides/bulk.md
@@ -8,6 +8,43 @@ The [Bulk API](https://opensearch.org/docs/latest/api-reference/document-apis/bu
## Bulk Indexing
+The `BulkIngester` is a helper class that simplifies bulk indexing by automatically buffering operations and flushing them to OpenSearch based on configurable thresholds. It provides:
+
+- Automatic flushing based on number of operations, total size in bytes, or time interval
+- Backpressure control to prevent overwhelming the cluster
+- Automatic retries with configurable backoff policies for failed operations
+- Thread-safe concurrent operation
+
+```java
+String indexName = "sample-index";
+
+// Create a BulkIngester with custom settings
+BulkIngester ingester = BulkIngester.of(b -> b
+ .client(client)
+ .maxOperations(1000) // Flush every 1000 operations
+ .flushInterval(5, TimeUnit.SECONDS) // Or every 5 seconds
+ .maxConcurrentRequests(2) // Allow 2 concurrent bulk requests
+);
+
+// Add operations - they are automatically buffered and flushed
+IndexData doc1 = new IndexData("Document 1", "The text of document 1");
+ingester.add(op -> op.index(i -> i.index(indexName).id("id1").document(doc1)));
+
+IndexData doc2 = new IndexData("Document 2", "The text of document 2");
+ingester.add(op -> op.index(i -> i.index(indexName).id("id2").document(doc2)));
+
+IndexData doc3 = new IndexData("Document 3", "The text of document 3");
+ingester.add(op -> op.index(i -> i.index(indexName).id("id3").document(doc3)));
+
+// Close the ingester - this flushes any remaining buffered operations
+ingester.close();
+```
+
+[IndexData](../samples/src/main/java/org/opensearch/client/samples/util/IndexData.java) refers to sample data class.
+
+You can find a working sample of the above code in [BulkIngesterBasics.java](../samples/src/main/java/org/opensearch/client/samples/BulkIngesterBasics.java).
+
+
## Bulk requests
```java
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java
index 009dc6cf63..29f6e64550 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java
@@ -126,6 +126,7 @@
import org.opensearch.client.opensearch.security.OpenSearchSecurityAsyncClient;
import org.opensearch.client.opensearch.snapshot.OpenSearchSnapshotAsyncClient;
import org.opensearch.client.opensearch.tasks.OpenSearchTasksAsyncClient;
+import org.opensearch.client.opensearch.ubi.OpenSearchUbiAsyncClient;
import org.opensearch.client.transport.JsonEndpoint;
import org.opensearch.client.transport.OpenSearchTransport;
import org.opensearch.client.transport.TransportOptions;
@@ -212,6 +213,10 @@ public OpenSearchTasksAsyncClient tasks() {
return new OpenSearchTasksAsyncClient(this.transport, this.transportOptions);
}
+ public OpenSearchUbiAsyncClient ubi() {
+ return new OpenSearchUbiAsyncClient(this.transport, this.transportOptions);
+ }
+
// ----- Endpoint: clear_scroll
/**
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java
index 46557ed513..e45e1661dd 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java
@@ -125,6 +125,7 @@
import org.opensearch.client.opensearch.security.OpenSearchSecurityClient;
import org.opensearch.client.opensearch.snapshot.OpenSearchSnapshotClient;
import org.opensearch.client.opensearch.tasks.OpenSearchTasksClient;
+import org.opensearch.client.opensearch.ubi.OpenSearchUbiClient;
import org.opensearch.client.transport.JsonEndpoint;
import org.opensearch.client.transport.OpenSearchTransport;
import org.opensearch.client.transport.TransportOptions;
@@ -211,6 +212,10 @@ public OpenSearchTasksClient tasks() {
return new OpenSearchTasksClient(this.transport, this.transportOptions);
}
+ public OpenSearchUbiClient ubi() {
+ return new OpenSearchUbiClient(this.transport, this.transportOptions);
+ }
+
// ----- Endpoint: clear_scroll
/**
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DerivedField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DerivedField.java
new file mode 100644
index 0000000000..eb2e081559
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DerivedField.java
@@ -0,0 +1,409 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * 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.
+ */
+
+/*
+ * Modifications Copyright OpenSearch Contributors. See
+ * GitHub history for details.
+ */
+
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
+package org.opensearch.client.opensearch._types;
+
+import jakarta.json.stream.JsonGenerator;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opensearch.client.json.JsonData;
+import org.opensearch.client.json.JsonpDeserializable;
+import org.opensearch.client.json.JsonpDeserializer;
+import org.opensearch.client.json.JsonpMapper;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
+import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
+
+// typedef: _types.DerivedField
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class DerivedField implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nullable
+ private final String format;
+
+ @Nullable
+ private final Boolean ignoreMalformed;
+
+ @Nonnull
+ private final String name;
+
+ @Nullable
+ private final String prefilterField;
+
+ @Nonnull
+ private final Map properties;
+
+ @Nonnull
+ private final Script script;
+
+ @Nonnull
+ private final String type;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private DerivedField(Builder builder) {
+ this.format = builder.format;
+ this.ignoreMalformed = builder.ignoreMalformed;
+ this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
+ this.prefilterField = builder.prefilterField;
+ this.properties = ApiTypeHelper.unmodifiable(builder.properties);
+ this.script = ApiTypeHelper.requireNonNull(builder.script, this, "script");
+ this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
+ }
+
+ public static DerivedField of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * API name: {@code format}
+ */
+ @Nullable
+ public final String format() {
+ return this.format;
+ }
+
+ /**
+ * API name: {@code ignore_malformed}
+ */
+ @Nullable
+ public final Boolean ignoreMalformed() {
+ return this.ignoreMalformed;
+ }
+
+ /**
+ * Required - API name: {@code name}
+ */
+ @Nonnull
+ public final String name() {
+ return this.name;
+ }
+
+ /**
+ * API name: {@code prefilter_field}
+ */
+ @Nullable
+ public final String prefilterField() {
+ return this.prefilterField;
+ }
+
+ /**
+ * API name: {@code properties}
+ */
+ @Nonnull
+ public final Map properties() {
+ return this.properties;
+ }
+
+ /**
+ * Required - API name: {@code script}
+ */
+ @Nonnull
+ public final Script script() {
+ return this.script;
+ }
+
+ /**
+ * Required - API name: {@code type}
+ */
+ @Nonnull
+ public final String type() {
+ return this.type;
+ }
+
+ /**
+ * Serialize this object to JSON.
+ */
+ @Override
+ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeStartObject();
+ serializeInternal(generator, mapper);
+ generator.writeEnd();
+ }
+
+ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ if (this.format != null) {
+ generator.writeKey("format");
+ generator.write(this.format);
+ }
+
+ if (this.ignoreMalformed != null) {
+ generator.writeKey("ignore_malformed");
+ generator.write(this.ignoreMalformed);
+ }
+
+ generator.writeKey("name");
+ generator.write(this.name);
+
+ if (this.prefilterField != null) {
+ generator.writeKey("prefilter_field");
+ generator.write(this.prefilterField);
+ }
+
+ if (ApiTypeHelper.isDefined(this.properties)) {
+ generator.writeKey("properties");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.properties.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
+ generator.writeEnd();
+ }
+
+ generator.writeKey("script");
+ this.script.serialize(generator, mapper);
+
+ generator.writeKey("type");
+ generator.write(this.type);
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link DerivedField}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private String format;
+ @Nullable
+ private Boolean ignoreMalformed;
+ private String name;
+ @Nullable
+ private String prefilterField;
+ @Nullable
+ private Map properties;
+ private Script script;
+ private String type;
+
+ public Builder() {}
+
+ private Builder(DerivedField o) {
+ this.format = o.format;
+ this.ignoreMalformed = o.ignoreMalformed;
+ this.name = o.name;
+ this.prefilterField = o.prefilterField;
+ this.properties = _mapCopy(o.properties);
+ this.script = o.script;
+ this.type = o.type;
+ }
+
+ private Builder(Builder o) {
+ this.format = o.format;
+ this.ignoreMalformed = o.ignoreMalformed;
+ this.name = o.name;
+ this.prefilterField = o.prefilterField;
+ this.properties = _mapCopy(o.properties);
+ this.script = o.script;
+ this.type = o.type;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * API name: {@code format}
+ */
+ @Nonnull
+ public final Builder format(@Nullable String value) {
+ this.format = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code ignore_malformed}
+ */
+ @Nonnull
+ public final Builder ignoreMalformed(@Nullable Boolean value) {
+ this.ignoreMalformed = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code name}
+ */
+ @Nonnull
+ public final Builder name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code prefilter_field}
+ */
+ @Nonnull
+ public final Builder prefilterField(@Nullable String value) {
+ this.prefilterField = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code properties}
+ *
+ *
+ * Adds all elements of map to properties.
+ *
+ */
+ @Nonnull
+ public final Builder properties(Map map) {
+ this.properties = _mapPutAll(this.properties, map);
+ return this;
+ }
+
+ /**
+ * API name: {@code properties}
+ *
+ *
+ * Adds an entry to properties.
+ *
+ */
+ @Nonnull
+ public final Builder properties(String key, JsonData value) {
+ this.properties = _mapPut(this.properties, key, value);
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code script}
+ */
+ @Nonnull
+ public final Builder script(Script value) {
+ this.script = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code script}
+ */
+ @Nonnull
+ public final Builder script(Function> fn) {
+ return script(fn.apply(new Script.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code type}
+ */
+ @Nonnull
+ public final Builder type(String value) {
+ this.type = value;
+ return this;
+ }
+
+ /**
+ * Builds a {@link DerivedField}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public DerivedField build() {
+ _checkSingleUse();
+
+ return new DerivedField(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link DerivedField}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ DerivedField::setupDerivedFieldDeserializer
+ );
+
+ protected static void setupDerivedFieldDeserializer(ObjectDeserializer op) {
+ op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format");
+ op.add(Builder::ignoreMalformed, JsonpDeserializer.booleanDeserializer(), "ignore_malformed");
+ op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
+ op.add(Builder::prefilterField, JsonpDeserializer.stringDeserializer(), "prefilter_field");
+ op.add(Builder::properties, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "properties");
+ op.add(Builder::script, Script._DESERIALIZER, "script");
+ op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.format);
+ result = 31 * result + Objects.hashCode(this.ignoreMalformed);
+ result = 31 * result + this.name.hashCode();
+ result = 31 * result + Objects.hashCode(this.prefilterField);
+ result = 31 * result + Objects.hashCode(this.properties);
+ result = 31 * result + this.script.hashCode();
+ result = 31 * result + this.type.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ DerivedField other = (DerivedField) o;
+ return Objects.equals(this.format, other.format)
+ && Objects.equals(this.ignoreMalformed, other.ignoreMalformed)
+ && this.name.equals(other.name)
+ && Objects.equals(this.prefilterField, other.prefilterField)
+ && Objects.equals(this.properties, other.properties)
+ && this.script.equals(other.script)
+ && this.type.equals(other.type);
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
index f7e967d882..68d84e9eab 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
@@ -67,6 +67,9 @@ public class ErrorCause implements PlainJsonSerializable, ToCopyableBuilder> header;
+
@Nonnull
private final Map metadata;
@@ -89,6 +92,7 @@ public class ErrorCause implements PlainJsonSerializable, ToCopyableBuilder> header() {
+ return this.header;
+ }
+
/**
* Any additional information about the error.
*/
@@ -186,6 +198,22 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.causedBy.serialize(generator, mapper);
}
+ if (ApiTypeHelper.isDefined(this.header)) {
+ generator.writeKey("header");
+ generator.writeStartObject();
+ for (Map.Entry> item0 : this.header.entrySet()) {
+ generator.writeKey(item0.getKey());
+ generator.writeStartArray();
+ if (item0.getValue() != null) {
+ for (String item1 : item0.getValue()) {
+ generator.write(item1);
+ }
+ }
+ generator.writeEnd();
+ }
+ generator.writeEnd();
+ }
+
if (this.reason != null) {
generator.writeKey("reason");
generator.write(this.reason);
@@ -238,6 +266,8 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
@Nullable
private ErrorCause causedBy;
@Nullable
+ private Map> header;
+ @Nullable
private Map metadata;
@Nullable
private String reason;
@@ -253,6 +283,7 @@ public Builder() {}
private Builder(ErrorCause o) {
this.causedBy = o.causedBy;
+ this.header = _mapCopy(o.header);
this.metadata = _mapCopy(o.metadata);
this.reason = o.reason;
this.rootCause = _listCopy(o.rootCause);
@@ -263,6 +294,7 @@ private Builder(ErrorCause o) {
private Builder(Builder o) {
this.causedBy = o.causedBy;
+ this.header = _mapCopy(o.header);
this.metadata = _mapCopy(o.metadata);
this.reason = o.reason;
this.rootCause = _listCopy(o.rootCause);
@@ -294,6 +326,32 @@ public final Builder causedBy(Function
+ * Adds all elements of map to header.
+ *
+ */
+ @Nonnull
+ public final Builder header(Map> map) {
+ this.header = _mapPutAll(this.header, map);
+ return this;
+ }
+
+ /**
+ * API name: {@code header}
+ *
+ *
+ * Adds an entry to header.
+ *
+ */
+ @Nonnull
+ public final Builder header(String key, List value) {
+ this.header = _mapPut(this.header, key, value);
+ return this;
+ }
+
/**
* Any additional information about the error.
*
@@ -458,6 +516,11 @@ public ErrorCause build() {
protected static void setupErrorCauseDeserializer(ObjectDeserializer op) {
op.add(Builder::causedBy, ErrorCause._DESERIALIZER, "caused_by");
+ op.add(
+ Builder::header,
+ JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer())),
+ "header"
+ );
op.add(Builder::reason, JsonpDeserializer.stringDeserializer(), "reason");
op.add(Builder::rootCause, JsonpDeserializer.arrayDeserializer(ErrorCause._DESERIALIZER), "root_cause");
op.add(Builder::stackTrace, JsonpDeserializer.stringDeserializer(), "stack_trace");
@@ -475,6 +538,7 @@ protected static void setupErrorCauseDeserializer(ObjectDeserializer {
- private final int canMatch;
+ private final long canMatch;
- private final int dfsPreQuery;
+ private final long dfsPreQuery;
- private final int dfsQuery;
+ private final long dfsQuery;
- private final int expand;
+ private final long expand;
- private final int fetch;
+ private final long fetch;
- private final int query;
+ private final long query;
// ---------------------------------------------------------------------------------------------
@@ -94,7 +94,7 @@ public static PhaseTook of(Function>
* API name: {@code can_match}
*
*/
- public final int canMatch() {
+ public final long canMatch() {
return this.canMatch;
}
@@ -104,7 +104,7 @@ public final int canMatch() {
* API name: {@code dfs_pre_query}
*
*/
- public final int dfsPreQuery() {
+ public final long dfsPreQuery() {
return this.dfsPreQuery;
}
@@ -114,7 +114,7 @@ public final int dfsPreQuery() {
* API name: {@code dfs_query}
*
*/
- public final int dfsQuery() {
+ public final long dfsQuery() {
return this.dfsQuery;
}
@@ -124,7 +124,7 @@ public final int dfsQuery() {
* API name: {@code expand}
*
*/
- public final int expand() {
+ public final long expand() {
return this.expand;
}
@@ -134,7 +134,7 @@ public final int expand() {
* API name: {@code fetch}
*
*/
- public final int fetch() {
+ public final long fetch() {
return this.fetch;
}
@@ -144,7 +144,7 @@ public final int fetch() {
* API name: {@code query}
*
*/
- public final int query() {
+ public final long query() {
return this.query;
}
@@ -195,12 +195,12 @@ public static Builder builder() {
* Builder for {@link PhaseTook}.
*/
public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
- private Integer canMatch;
- private Integer dfsPreQuery;
- private Integer dfsQuery;
- private Integer expand;
- private Integer fetch;
- private Integer query;
+ private Long canMatch;
+ private Long dfsPreQuery;
+ private Long dfsQuery;
+ private Long expand;
+ private Long fetch;
+ private Long query;
public Builder() {}
@@ -235,7 +235,7 @@ public Builder copy() {
*
*/
@Nonnull
- public final Builder canMatch(int value) {
+ public final Builder canMatch(long value) {
this.canMatch = value;
return this;
}
@@ -247,7 +247,7 @@ public final Builder canMatch(int value) {
*
*/
@Nonnull
- public final Builder dfsPreQuery(int value) {
+ public final Builder dfsPreQuery(long value) {
this.dfsPreQuery = value;
return this;
}
@@ -259,7 +259,7 @@ public final Builder dfsPreQuery(int value) {
*
*/
@Nonnull
- public final Builder dfsQuery(int value) {
+ public final Builder dfsQuery(long value) {
this.dfsQuery = value;
return this;
}
@@ -271,7 +271,7 @@ public final Builder dfsQuery(int value) {
*
*/
@Nonnull
- public final Builder expand(int value) {
+ public final Builder expand(long value) {
this.expand = value;
return this;
}
@@ -283,7 +283,7 @@ public final Builder expand(int value) {
*
*/
@Nonnull
- public final Builder fetch(int value) {
+ public final Builder fetch(long value) {
this.fetch = value;
return this;
}
@@ -295,7 +295,7 @@ public final Builder fetch(int value) {
*
*/
@Nonnull
- public final Builder query(int value) {
+ public final Builder query(long value) {
this.query = value;
return this;
}
@@ -325,23 +325,23 @@ public PhaseTook build() {
);
protected static void setupPhaseTookDeserializer(ObjectDeserializer op) {
- op.add(Builder::canMatch, JsonpDeserializer.integerDeserializer(), "can_match");
- op.add(Builder::dfsPreQuery, JsonpDeserializer.integerDeserializer(), "dfs_pre_query");
- op.add(Builder::dfsQuery, JsonpDeserializer.integerDeserializer(), "dfs_query");
- op.add(Builder::expand, JsonpDeserializer.integerDeserializer(), "expand");
- op.add(Builder::fetch, JsonpDeserializer.integerDeserializer(), "fetch");
- op.add(Builder::query, JsonpDeserializer.integerDeserializer(), "query");
+ op.add(Builder::canMatch, JsonpDeserializer.longDeserializer(), "can_match");
+ op.add(Builder::dfsPreQuery, JsonpDeserializer.longDeserializer(), "dfs_pre_query");
+ op.add(Builder::dfsQuery, JsonpDeserializer.longDeserializer(), "dfs_query");
+ op.add(Builder::expand, JsonpDeserializer.longDeserializer(), "expand");
+ op.add(Builder::fetch, JsonpDeserializer.longDeserializer(), "fetch");
+ op.add(Builder::query, JsonpDeserializer.longDeserializer(), "query");
}
@Override
public int hashCode() {
int result = 17;
- result = 31 * result + Integer.hashCode(this.canMatch);
- result = 31 * result + Integer.hashCode(this.dfsPreQuery);
- result = 31 * result + Integer.hashCode(this.dfsQuery);
- result = 31 * result + Integer.hashCode(this.expand);
- result = 31 * result + Integer.hashCode(this.fetch);
- result = 31 * result + Integer.hashCode(this.query);
+ result = 31 * result + Long.hashCode(this.canMatch);
+ result = 31 * result + Long.hashCode(this.dfsPreQuery);
+ result = 31 * result + Long.hashCode(this.dfsQuery);
+ result = 31 * result + Long.hashCode(this.expand);
+ result = 31 * result + Long.hashCode(this.fetch);
+ result = 31 * result + Long.hashCode(this.query);
return result;
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java
index c8dd0863ec..c46b364053 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java
@@ -66,6 +66,8 @@ public class ShardFailure implements PlainJsonSerializable, ToCopyableBuilder op) {
op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index");
op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node");
+ op.add(Builder::primary, JsonpDeserializer.booleanDeserializer(), "primary");
op.add(Builder::reason, ErrorCause._DESERIALIZER, "reason");
op.add(Builder::shard, JsonpDeserializer.integerDeserializer(), "shard");
op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status");
@@ -300,6 +326,7 @@ public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.index);
result = 31 * result + Objects.hashCode(this.node);
+ result = 31 * result + Boolean.hashCode(this.primary);
result = 31 * result + this.reason.hashCode();
result = 31 * result + Integer.hashCode(this.shard);
result = 31 * result + Objects.hashCode(this.status);
@@ -313,6 +340,7 @@ public boolean equals(Object o) {
ShardFailure other = (ShardFailure) o;
return Objects.equals(this.index, other.index)
&& Objects.equals(this.node, other.node)
+ && this.primary == other.primary
&& this.reason.equals(other.reason)
&& this.shard == other.shard
&& Objects.equals(this.status, other.status);
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregation.java
index 661b984988..57994ec30d 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregation.java
@@ -159,21 +159,16 @@ public final AggregationVariant _get() {
return _value;
}
- @Nonnull
- private final Map aggregations;
-
@Nonnull
private final Map meta;
public Aggregation(AggregationVariant value) {
this._kind = ApiTypeHelper.requireNonNull(value._aggregationKind(), this, "");
this._value = ApiTypeHelper.requireNonNull(value, this, "");
- this.aggregations = null;
this.meta = null;
}
private Aggregation(Builder builder) {
- this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations);
this.meta = ApiTypeHelper.unmodifiable(builder.meta);
this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, "");
this._value = ApiTypeHelper.requireNonNull(builder._value, builder, "");
@@ -183,17 +178,6 @@ public static Aggregation of(Function
- * API name: {@code aggregations}
- *
- */
- @Nonnull
- public final Map aggregations() {
- return this.aggregations;
- }
-
/**
* API name: {@code meta}
*/
@@ -1245,16 +1229,6 @@ public WeightedAverageAggregation weightedAvg() {
@Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
- if (ApiTypeHelper.isDefined(this.aggregations)) {
- generator.writeKey("aggregations");
- generator.writeStartObject();
- for (Map.Entry item0 : this.aggregations.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
- }
- generator.writeEnd();
- }
-
if (ApiTypeHelper.isDefined(this.meta)) {
generator.writeKey("meta");
generator.writeStartObject();
@@ -1285,66 +1259,16 @@ public static class Builder extends ObjectBuilderBase {
private Kind _kind;
private AggregationVariant _value;
@Nullable
- private Map aggregations;
- @Nullable
private Map meta;
public Builder() {}
private Builder(Aggregation o) {
- this.aggregations = _mapCopy(o.aggregations);
this.meta = _mapCopy(o.meta);
this._kind = o._kind;
this._value = o._value;
}
- /**
- * Sub-aggregations for this aggregation. Only applies to bucket aggregations.
- *
- * API name: {@code aggregations}
- *
- *
- *
- * Adds all elements of map to aggregations.
- *
- */
- @Nonnull
- public final Builder aggregations(Map map) {
- this.aggregations = _mapPutAll(this.aggregations, map);
- return this;
- }
-
- /**
- * Sub-aggregations for this aggregation. Only applies to bucket aggregations.
- *
- * API name: {@code aggregations}
- *
- *
- *
- * Adds an entry to aggregations.
- *
- */
- @Nonnull
- public final Builder aggregations(String key, Aggregation value) {
- this.aggregations = _mapPut(this.aggregations, key, value);
- return this;
- }
-
- /**
- * Sub-aggregations for this aggregation. Only applies to bucket aggregations.
- *
- * API name: {@code aggregations}
- *
- *
- *
- * Adds a value to aggregations using a builder lambda.
- *
- */
- @Nonnull
- public final Builder aggregations(String key, Function> fn) {
- return aggregations(key, fn.apply(new Aggregation.Builder()).build());
- }
-
/**
* API name: {@code meta}
*
@@ -2055,53 +1979,6 @@ protected Aggregation build() {
public class ContainerBuilder implements ObjectBuilder {
private ContainerBuilder() {}
- /**
- * Sub-aggregations for this aggregation. Only applies to bucket aggregations.
- *
- * API name: {@code aggregations}
- *
- *
- *
- * Adds all elements of map to aggregations.
- *
- */
- @Nonnull
- public final ContainerBuilder aggregations(Map map) {
- Builder.this.aggregations = _mapPutAll(Builder.this.aggregations, map);
- return this;
- }
-
- /**
- * Sub-aggregations for this aggregation. Only applies to bucket aggregations.
- *
- * API name: {@code aggregations}
- *
- *
- *
- * Adds an entry to aggregations.
- *
- */
- @Nonnull
- public final ContainerBuilder aggregations(String key, Aggregation value) {
- Builder.this.aggregations = _mapPut(Builder.this.aggregations, key, value);
- return this;
- }
-
- /**
- * Sub-aggregations for this aggregation. Only applies to bucket aggregations.
- *
- * API name: {@code aggregations}
- *
- *
- *
- * Adds a value to aggregations using a builder lambda.
- *
- */
- @Nonnull
- public final ContainerBuilder aggregations(String key, Function> fn) {
- return aggregations(key, fn.apply(new Aggregation.Builder()).build());
- }
-
/**
* API name: {@code meta}
*
@@ -2136,7 +2013,6 @@ public Aggregation build() {
}
protected static void setupAggregationDeserializer(ObjectDeserializer op) {
- op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggregations", "aggs");
op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta");
op.add(Builder::adjacencyMatrix, AdjacencyMatrixAggregation._DESERIALIZER, "adjacency_matrix");
op.add(Builder::autoDateHistogram, AutoDateHistogramAggregation._DESERIALIZER, "auto_date_histogram");
@@ -2216,7 +2092,6 @@ public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this._kind);
result = 31 * result + Objects.hashCode(this._value);
- result = 31 * result + Objects.hashCode(this.aggregations);
result = 31 * result + Objects.hashCode(this.meta);
return result;
}
@@ -2228,7 +2103,6 @@ public boolean equals(Object o) {
Aggregation other = (Aggregation) o;
return Objects.equals(this._kind, other._kind)
&& Objects.equals(this._value, other._value)
- && Objects.equals(this.aggregations, other.aggregations)
&& Objects.equals(this.meta, other.meta);
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketAggregationBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketAggregationBase.java
index 4ab6fd521f..c803a45540 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketAggregationBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketAggregationBase.java
@@ -36,35 +36,199 @@
package org.opensearch.client.opensearch._types.aggregations;
+import jakarta.json.stream.JsonGenerator;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opensearch.client.json.JsonpDeserializer;
+import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.ObjectBuilder;
// typedef: _types.aggregations.BucketAggregationBase
@Generated("org.opensearch.client.codegen.CodeGenerator")
public abstract class BucketAggregationBase extends AggregationBase {
+ @Nonnull
+ private final Map aggregations;
+
+ @Nonnull
+ private final Map aggs;
+
// ---------------------------------------------------------------------------------------------
protected BucketAggregationBase(AbstractBuilder> builder) {
super(builder);
+ this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations);
+ this.aggs = ApiTypeHelper.unmodifiable(builder.aggs);
+ }
+
+ /**
+ * Sub-aggregations for this bucket aggregation
+ *
+ * API name: {@code aggregations}
+ *
+ */
+ @Nonnull
+ public final Map aggregations() {
+ return this.aggregations;
+ }
+
+ /**
+ * Sub-aggregations for this bucket aggregation
+ *
+ * API name: {@code aggs}
+ *
+ */
+ @Nonnull
+ public final Map aggs() {
+ return this.aggs;
+ }
+
+ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ super.serializeInternal(generator, mapper);
+ if (ApiTypeHelper.isDefined(this.aggregations)) {
+ generator.writeKey("aggregations");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.aggregations.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
+ generator.writeEnd();
+ }
+
+ if (ApiTypeHelper.isDefined(this.aggs)) {
+ generator.writeKey("aggs");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.aggs.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
+ generator.writeEnd();
+ }
}
// ---------------------------------------------------------------------------------------------
public abstract static class AbstractBuilder> extends AggregationBase.AbstractBuilder<
BuilderT> {
+ @Nullable
+ private Map aggregations;
+ @Nullable
+ private Map aggs;
protected AbstractBuilder() {}
protected AbstractBuilder(BucketAggregationBase o) {
super(o);
+ this.aggregations = _mapCopy(o.aggregations);
+ this.aggs = _mapCopy(o.aggs);
}
protected AbstractBuilder(AbstractBuilder o) {
super(o);
+ this.aggregations = _mapCopy(o.aggregations);
+ this.aggs = _mapCopy(o.aggs);
}
+ /**
+ * Sub-aggregations for this bucket aggregation
+ *
+ * API name: {@code aggregations}
+ *
+ *
+ *
+ * Adds all elements of map to aggregations.
+ *
+ */
+ @Nonnull
+ public final BuilderT aggregations(Map map) {
+ this.aggregations = _mapPutAll(this.aggregations, map);
+ return self();
+ }
+
+ /**
+ * Sub-aggregations for this bucket aggregation
+ *
+ * API name: {@code aggregations}
+ *
+ *
+ *
+ * Adds an entry to aggregations.
+ *
+ */
+ @Nonnull
+ public final BuilderT aggregations(String key, Aggregation value) {
+ this.aggregations = _mapPut(this.aggregations, key, value);
+ return self();
+ }
+
+ /**
+ * Sub-aggregations for this bucket aggregation
+ *
+ * API name: {@code aggregations}
+ *
+ *
+ *
+ * Adds a value to aggregations using a builder lambda.
+ *
+ */
+ @Nonnull
+ public final BuilderT aggregations(String key, Function> fn) {
+ return aggregations(key, fn.apply(new Aggregation.Builder()).build());
+ }
+
+ /**
+ * Sub-aggregations for this bucket aggregation
+ *
+ * API name: {@code aggs}
+ *
+ *
+ *
+ * Adds all elements of map to aggs.
+ *
+ */
+ @Nonnull
+ public final BuilderT aggs(Map map) {
+ this.aggs = _mapPutAll(this.aggs, map);
+ return self();
+ }
+
+ /**
+ * Sub-aggregations for this bucket aggregation
+ *
+ * API name: {@code aggs}
+ *
+ *
+ *
+ * Adds an entry to aggs.
+ *
+ */
+ @Nonnull
+ public final BuilderT aggs(String key, Aggregation value) {
+ this.aggs = _mapPut(this.aggs, key, value);
+ return self();
+ }
+
+ /**
+ * Sub-aggregations for this bucket aggregation
+ *
+ * API name: {@code aggs}
+ *
+ *
+ *
+ * Adds a value to aggs using a builder lambda.
+ *
+ */
+ @Nonnull
+ public final BuilderT aggs(String key, Function> fn) {
+ return aggs(key, fn.apply(new Aggregation.Builder()).build());
+ }
}
// ---------------------------------------------------------------------------------------------
@@ -73,11 +237,15 @@ protected static > void setupBucketAg
ObjectDeserializer op
) {
setupAggregationBaseDeserializer(op);
+ op.add(AbstractBuilder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggregations");
+ op.add(AbstractBuilder::aggs, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggs");
}
@Override
public int hashCode() {
int result = super.hashCode();
+ result = 31 * result + Objects.hashCode(this.aggregations);
+ result = 31 * result + Objects.hashCode(this.aggs);
return result;
}
@@ -88,6 +256,7 @@ public boolean equals(Object o) {
}
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
- return true;
+ BucketAggregationBase other = (BucketAggregationBase) o;
+ return Objects.equals(this.aggregations, other.aggregations) && Objects.equals(this.aggs, other.aggs);
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java
index ab3f5f2ea5..46adb8cbee 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java
@@ -66,16 +66,12 @@ public class CardinalityAggregation extends MetricAggregationBase
@Nullable
private final Integer precisionThreshold;
- @Nullable
- private final Boolean rehash;
-
// ---------------------------------------------------------------------------------------------
private CardinalityAggregation(Builder builder) {
super(builder);
this.executionHint = builder.executionHint;
this.precisionThreshold = builder.precisionThreshold;
- this.rehash = builder.rehash;
}
public static CardinalityAggregation of(Function> fn) {
@@ -109,14 +105,6 @@ public final Integer precisionThreshold() {
return this.precisionThreshold;
}
- /**
- * API name: {@code rehash}
- */
- @Nullable
- public final Boolean rehash() {
- return this.rehash;
- }
-
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
super.serializeInternal(generator, mapper);
if (this.executionHint != null) {
@@ -128,11 +116,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("precision_threshold");
generator.write(this.precisionThreshold);
}
-
- if (this.rehash != null) {
- generator.writeKey("rehash");
- generator.write(this.rehash);
- }
}
// ---------------------------------------------------------------------------------------------
@@ -158,8 +141,6 @@ public static class Builder extends MetricAggregationBase.AbstractBuilder> order;
@Nullable
private final Script script;
+ @Nullable
+ private final Integer shardMinDocCount;
+
@Nullable
private final Integer shardSize;
@@ -126,10 +123,9 @@ private TermsAggregation(Builder builder) {
this.include = builder.include;
this.minDocCount = builder.minDocCount;
this.missing = builder.missing;
- this.missingBucket = builder.missingBucket;
- this.missingOrder = builder.missingOrder;
this.order = ApiTypeHelper.unmodifiable(builder.order);
this.script = builder.script;
+ this.shardMinDocCount = builder.shardMinDocCount;
this.shardSize = builder.shardSize;
this.showTermDocCountError = builder.showTermDocCountError;
this.size = builder.size;
@@ -215,22 +211,6 @@ public final FieldValue missing() {
return this.missing;
}
- /**
- * API name: {@code missing_bucket}
- */
- @Nullable
- public final Boolean missingBucket() {
- return this.missingBucket;
- }
-
- /**
- * API name: {@code missing_order}
- */
- @Nullable
- public final MissingOrder missingOrder() {
- return this.missingOrder;
- }
-
/**
* API name: {@code order}
*/
@@ -247,6 +227,17 @@ public final Script script() {
return this.script;
}
+ /**
+ * The minimum number of documents in a bucket on each shard for it to be returned.
+ *
+ * API name: {@code shard_min_doc_count}
+ *
+ */
+ @Nullable
+ public final Integer shardMinDocCount() {
+ return this.shardMinDocCount;
+ }
+
/**
* The number of candidate terms produced by each shard. By default, shard_size will be automatically estimated based on
* the number of shards and the size parameter.
@@ -335,16 +326,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.missing.serialize(generator, mapper);
}
- if (this.missingBucket != null) {
- generator.writeKey("missing_bucket");
- generator.write(this.missingBucket);
- }
-
- if (this.missingOrder != null) {
- generator.writeKey("missing_order");
- this.missingOrder.serialize(generator, mapper);
- }
-
if (ApiTypeHelper.isDefined(this.order)) {
generator.writeKey("order");
generator.writeStartArray();
@@ -366,6 +347,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.script.serialize(generator, mapper);
}
+ if (this.shardMinDocCount != null) {
+ generator.writeKey("shard_min_doc_count");
+ generator.write(this.shardMinDocCount);
+ }
+
if (this.shardSize != null) {
generator.writeKey("shard_size");
generator.write(this.shardSize);
@@ -423,14 +409,12 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder> order;
@Nullable
private Script script;
@Nullable
+ private Integer shardMinDocCount;
+ @Nullable
private Integer shardSize;
@Nullable
private Boolean showTermDocCountError;
@@ -451,10 +435,9 @@ private Builder(TermsAggregation o) {
this.include = o.include;
this.minDocCount = o.minDocCount;
this.missing = o.missing;
- this.missingBucket = o.missingBucket;
- this.missingOrder = o.missingOrder;
this.order = _listCopy(o.order);
this.script = o.script;
+ this.shardMinDocCount = o.shardMinDocCount;
this.shardSize = o.shardSize;
this.showTermDocCountError = o.showTermDocCountError;
this.size = o.size;
@@ -471,10 +454,9 @@ private Builder(Builder o) {
this.include = o.include;
this.minDocCount = o.minDocCount;
this.missing = o.missing;
- this.missingBucket = o.missingBucket;
- this.missingOrder = o.missingOrder;
this.order = _listCopy(o.order);
this.script = o.script;
+ this.shardMinDocCount = o.shardMinDocCount;
this.shardSize = o.shardSize;
this.showTermDocCountError = o.showTermDocCountError;
this.size = o.size;
@@ -592,24 +574,6 @@ public final Builder missing(Function> fn)
return script(fn.apply(new Script.Builder()).build());
}
+ /**
+ * The minimum number of documents in a bucket on each shard for it to be returned.
+ *
+ * API name: {@code shard_min_doc_count}
+ *
+ */
+ @Nonnull
+ public final Builder shardMinDocCount(@Nullable Integer value) {
+ this.shardMinDocCount = value;
+ return this;
+ }
+
/**
* The number of candidate terms produced by each shard. By default, shard_size will be automatically estimated based
* on the number of shards and the size parameter.
@@ -737,14 +713,13 @@ protected static void setupTermsAggregationDeserializer(ObjectDeserializer searchAsYouType(
return this.searchAsYouType(fn.apply(new SearchAsYouTypeProperty.Builder()).build());
}
+ public ObjectBuilder semantic(SemanticProperty v) {
+ this._kind = Kind.Semantic;
+ this._value = v;
+ return this;
+ }
+
+ public ObjectBuilder semantic(Function> fn) {
+ return this.semantic(fn.apply(new SemanticProperty.Builder()).build());
+ }
+
public ObjectBuilder short_(ShortNumberProperty v) {
this._kind = Kind.Short;
this._value = v;
@@ -1429,6 +1456,7 @@ protected static void setupPropertyDeserializer(ObjectDeserializer op)
op.add(Builder::rankFeatures, RankFeaturesProperty._DESERIALIZER, "rank_features");
op.add(Builder::scaledFloat, ScaledFloatNumberProperty._DESERIALIZER, "scaled_float");
op.add(Builder::searchAsYouType, SearchAsYouTypeProperty._DESERIALIZER, "search_as_you_type");
+ op.add(Builder::semantic, SemanticProperty._DESERIALIZER, "semantic");
op.add(Builder::short_, ShortNumberProperty._DESERIALIZER, "short");
op.add(Builder::text, TextProperty._DESERIALIZER, "text");
op.add(Builder::tokenCount, TokenCountProperty._DESERIALIZER, "token_count");
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PropertyBuilders.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PropertyBuilders.java
index db1850e193..ff4be039c7 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PropertyBuilders.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PropertyBuilders.java
@@ -311,6 +311,13 @@ public static SearchAsYouTypeProperty.Builder searchAsYouType() {
return new SearchAsYouTypeProperty.Builder();
}
+ /**
+ * Creates a builder for the {@link SemanticProperty semantic} {@code Property} variant.
+ */
+ public static SemanticProperty.Builder semantic() {
+ return new SemanticProperty.Builder();
+ }
+
/**
* Creates a builder for the {@link ShortNumberProperty short} {@code Property} variant.
*/
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticDenseEmbeddingConfig.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticDenseEmbeddingConfig.java
new file mode 100644
index 0000000000..a517946454
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticDenseEmbeddingConfig.java
@@ -0,0 +1,299 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * 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.
+ */
+
+/*
+ * Modifications Copyright OpenSearch Contributors. See
+ * GitHub history for details.
+ */
+
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
+package org.opensearch.client.opensearch._types.mapping;
+
+import jakarta.json.stream.JsonGenerator;
+import java.util.Objects;
+import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opensearch.client.json.JsonpDeserializable;
+import org.opensearch.client.json.JsonpDeserializer;
+import org.opensearch.client.json.JsonpMapper;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.util.CopyableBuilder;
+import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
+
+// typedef: _types.mapping.SemanticDenseEmbeddingConfig
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class SemanticDenseEmbeddingConfig
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nullable
+ private final String compressionLevel;
+
+ @Nullable
+ private final String dataType;
+
+ @Nullable
+ private final KnnVectorMethod method;
+
+ @Nullable
+ private final String mode;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private SemanticDenseEmbeddingConfig(Builder builder) {
+ this.compressionLevel = builder.compressionLevel;
+ this.dataType = builder.dataType;
+ this.method = builder.method;
+ this.mode = builder.mode;
+ }
+
+ public static SemanticDenseEmbeddingConfig of(
+ Function> fn
+ ) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * API name: {@code compression_level}
+ */
+ @Nullable
+ public final String compressionLevel() {
+ return this.compressionLevel;
+ }
+
+ /**
+ * API name: {@code data_type}
+ */
+ @Nullable
+ public final String dataType() {
+ return this.dataType;
+ }
+
+ /**
+ * API name: {@code method}
+ */
+ @Nullable
+ public final KnnVectorMethod method() {
+ return this.method;
+ }
+
+ /**
+ * API name: {@code mode}
+ */
+ @Nullable
+ public final String mode() {
+ return this.mode;
+ }
+
+ /**
+ * Serialize this object to JSON.
+ */
+ @Override
+ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeStartObject();
+ serializeInternal(generator, mapper);
+ generator.writeEnd();
+ }
+
+ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ if (this.compressionLevel != null) {
+ generator.writeKey("compression_level");
+ generator.write(this.compressionLevel);
+ }
+
+ if (this.dataType != null) {
+ generator.writeKey("data_type");
+ generator.write(this.dataType);
+ }
+
+ if (this.method != null) {
+ generator.writeKey("method");
+ this.method.serialize(generator, mapper);
+ }
+
+ if (this.mode != null) {
+ generator.writeKey("mode");
+ generator.write(this.mode);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link SemanticDenseEmbeddingConfig}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private String compressionLevel;
+ @Nullable
+ private String dataType;
+ @Nullable
+ private KnnVectorMethod method;
+ @Nullable
+ private String mode;
+
+ public Builder() {}
+
+ private Builder(SemanticDenseEmbeddingConfig o) {
+ this.compressionLevel = o.compressionLevel;
+ this.dataType = o.dataType;
+ this.method = o.method;
+ this.mode = o.mode;
+ }
+
+ private Builder(Builder o) {
+ this.compressionLevel = o.compressionLevel;
+ this.dataType = o.dataType;
+ this.method = o.method;
+ this.mode = o.mode;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * API name: {@code compression_level}
+ */
+ @Nonnull
+ public final Builder compressionLevel(@Nullable String value) {
+ this.compressionLevel = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code data_type}
+ */
+ @Nonnull
+ public final Builder dataType(@Nullable String value) {
+ this.dataType = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code method}
+ */
+ @Nonnull
+ public final Builder method(@Nullable KnnVectorMethod value) {
+ this.method = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code method}
+ */
+ @Nonnull
+ public final Builder method(Function> fn) {
+ return method(fn.apply(new KnnVectorMethod.Builder()).build());
+ }
+
+ /**
+ * API name: {@code mode}
+ */
+ @Nonnull
+ public final Builder mode(@Nullable String value) {
+ this.mode = value;
+ return this;
+ }
+
+ /**
+ * Builds a {@link SemanticDenseEmbeddingConfig}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public SemanticDenseEmbeddingConfig build() {
+ _checkSingleUse();
+
+ return new SemanticDenseEmbeddingConfig(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link SemanticDenseEmbeddingConfig}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ SemanticDenseEmbeddingConfig::setupSemanticDenseEmbeddingConfigDeserializer
+ );
+
+ protected static void setupSemanticDenseEmbeddingConfigDeserializer(ObjectDeserializer op) {
+ op.add(Builder::compressionLevel, JsonpDeserializer.stringDeserializer(), "compression_level");
+ op.add(Builder::dataType, JsonpDeserializer.stringDeserializer(), "data_type");
+ op.add(Builder::method, KnnVectorMethod._DESERIALIZER, "method");
+ op.add(Builder::mode, JsonpDeserializer.stringDeserializer(), "mode");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.compressionLevel);
+ result = 31 * result + Objects.hashCode(this.dataType);
+ result = 31 * result + Objects.hashCode(this.method);
+ result = 31 * result + Objects.hashCode(this.mode);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ SemanticDenseEmbeddingConfig other = (SemanticDenseEmbeddingConfig) o;
+ return Objects.equals(this.compressionLevel, other.compressionLevel)
+ && Objects.equals(this.dataType, other.dataType)
+ && Objects.equals(this.method, other.method)
+ && Objects.equals(this.mode, other.mode);
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticProperty.java
new file mode 100644
index 0000000000..a3cb00a9d5
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticProperty.java
@@ -0,0 +1,485 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * 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.
+ */
+
+/*
+ * Modifications Copyright OpenSearch Contributors. See
+ * GitHub history for details.
+ */
+
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
+package org.opensearch.client.opensearch._types.mapping;
+
+import jakarta.json.stream.JsonGenerator;
+import java.util.Objects;
+import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opensearch.client.json.JsonData;
+import org.opensearch.client.json.JsonpDeserializable;
+import org.opensearch.client.json.JsonpDeserializer;
+import org.opensearch.client.json.JsonpMapper;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
+import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
+
+// typedef: _types.mapping.SemanticProperty
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class SemanticProperty
+ implements
+ PropertyVariant,
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nullable
+ private final JsonData chunking;
+
+ @Nullable
+ private final SemanticDenseEmbeddingConfig denseEmbeddingConfig;
+
+ @Nonnull
+ private final String modelId;
+
+ @Nullable
+ private final String rawFieldType;
+
+ @Nullable
+ private final String searchModelId;
+
+ @Nullable
+ private final String semanticFieldSearchAnalyzer;
+
+ @Nullable
+ private final String semanticInfoFieldName;
+
+ @Nullable
+ private final Boolean skipExistingEmbedding;
+
+ @Nullable
+ private final SemanticSparseEncodingConfig sparseEncodingConfig;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private SemanticProperty(Builder builder) {
+ this.chunking = builder.chunking;
+ this.denseEmbeddingConfig = builder.denseEmbeddingConfig;
+ this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId");
+ this.rawFieldType = builder.rawFieldType;
+ this.searchModelId = builder.searchModelId;
+ this.semanticFieldSearchAnalyzer = builder.semanticFieldSearchAnalyzer;
+ this.semanticInfoFieldName = builder.semanticInfoFieldName;
+ this.skipExistingEmbedding = builder.skipExistingEmbedding;
+ this.sparseEncodingConfig = builder.sparseEncodingConfig;
+ }
+
+ public static SemanticProperty of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * {@link Property} variant kind.
+ */
+ @Override
+ public Property.Kind _propertyKind() {
+ return Property.Kind.Semantic;
+ }
+
+ /**
+ * API name: {@code chunking}
+ */
+ @Nullable
+ public final JsonData chunking() {
+ return this.chunking;
+ }
+
+ /**
+ * API name: {@code dense_embedding_config}
+ */
+ @Nullable
+ public final SemanticDenseEmbeddingConfig denseEmbeddingConfig() {
+ return this.denseEmbeddingConfig;
+ }
+
+ /**
+ * Required - API name: {@code model_id}
+ */
+ @Nonnull
+ public final String modelId() {
+ return this.modelId;
+ }
+
+ /**
+ * API name: {@code raw_field_type}
+ */
+ @Nullable
+ public final String rawFieldType() {
+ return this.rawFieldType;
+ }
+
+ /**
+ * API name: {@code search_model_id}
+ */
+ @Nullable
+ public final String searchModelId() {
+ return this.searchModelId;
+ }
+
+ /**
+ * API name: {@code semantic_field_search_analyzer}
+ */
+ @Nullable
+ public final String semanticFieldSearchAnalyzer() {
+ return this.semanticFieldSearchAnalyzer;
+ }
+
+ /**
+ * API name: {@code semantic_info_field_name}
+ */
+ @Nullable
+ public final String semanticInfoFieldName() {
+ return this.semanticInfoFieldName;
+ }
+
+ /**
+ * API name: {@code skip_existing_embedding}
+ */
+ @Nullable
+ public final Boolean skipExistingEmbedding() {
+ return this.skipExistingEmbedding;
+ }
+
+ /**
+ * API name: {@code sparse_encoding_config}
+ */
+ @Nullable
+ public final SemanticSparseEncodingConfig sparseEncodingConfig() {
+ return this.sparseEncodingConfig;
+ }
+
+ /**
+ * Serialize this object to JSON.
+ */
+ @Override
+ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeStartObject();
+ serializeInternal(generator, mapper);
+ generator.writeEnd();
+ }
+
+ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ generator.write("type", "semantic");
+ if (this.chunking != null) {
+ generator.writeKey("chunking");
+ this.chunking.serialize(generator, mapper);
+ }
+
+ if (this.denseEmbeddingConfig != null) {
+ generator.writeKey("dense_embedding_config");
+ this.denseEmbeddingConfig.serialize(generator, mapper);
+ }
+
+ generator.writeKey("model_id");
+ generator.write(this.modelId);
+
+ if (this.rawFieldType != null) {
+ generator.writeKey("raw_field_type");
+ generator.write(this.rawFieldType);
+ }
+
+ if (this.searchModelId != null) {
+ generator.writeKey("search_model_id");
+ generator.write(this.searchModelId);
+ }
+
+ if (this.semanticFieldSearchAnalyzer != null) {
+ generator.writeKey("semantic_field_search_analyzer");
+ generator.write(this.semanticFieldSearchAnalyzer);
+ }
+
+ if (this.semanticInfoFieldName != null) {
+ generator.writeKey("semantic_info_field_name");
+ generator.write(this.semanticInfoFieldName);
+ }
+
+ if (this.skipExistingEmbedding != null) {
+ generator.writeKey("skip_existing_embedding");
+ generator.write(this.skipExistingEmbedding);
+ }
+
+ if (this.sparseEncodingConfig != null) {
+ generator.writeKey("sparse_encoding_config");
+ this.sparseEncodingConfig.serialize(generator, mapper);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link SemanticProperty}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private JsonData chunking;
+ @Nullable
+ private SemanticDenseEmbeddingConfig denseEmbeddingConfig;
+ private String modelId;
+ @Nullable
+ private String rawFieldType;
+ @Nullable
+ private String searchModelId;
+ @Nullable
+ private String semanticFieldSearchAnalyzer;
+ @Nullable
+ private String semanticInfoFieldName;
+ @Nullable
+ private Boolean skipExistingEmbedding;
+ @Nullable
+ private SemanticSparseEncodingConfig sparseEncodingConfig;
+
+ public Builder() {}
+
+ private Builder(SemanticProperty o) {
+ this.chunking = o.chunking;
+ this.denseEmbeddingConfig = o.denseEmbeddingConfig;
+ this.modelId = o.modelId;
+ this.rawFieldType = o.rawFieldType;
+ this.searchModelId = o.searchModelId;
+ this.semanticFieldSearchAnalyzer = o.semanticFieldSearchAnalyzer;
+ this.semanticInfoFieldName = o.semanticInfoFieldName;
+ this.skipExistingEmbedding = o.skipExistingEmbedding;
+ this.sparseEncodingConfig = o.sparseEncodingConfig;
+ }
+
+ private Builder(Builder o) {
+ this.chunking = o.chunking;
+ this.denseEmbeddingConfig = o.denseEmbeddingConfig;
+ this.modelId = o.modelId;
+ this.rawFieldType = o.rawFieldType;
+ this.searchModelId = o.searchModelId;
+ this.semanticFieldSearchAnalyzer = o.semanticFieldSearchAnalyzer;
+ this.semanticInfoFieldName = o.semanticInfoFieldName;
+ this.skipExistingEmbedding = o.skipExistingEmbedding;
+ this.sparseEncodingConfig = o.sparseEncodingConfig;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * API name: {@code chunking}
+ */
+ @Nonnull
+ public final Builder chunking(@Nullable JsonData value) {
+ this.chunking = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code dense_embedding_config}
+ */
+ @Nonnull
+ public final Builder denseEmbeddingConfig(@Nullable SemanticDenseEmbeddingConfig value) {
+ this.denseEmbeddingConfig = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code dense_embedding_config}
+ */
+ @Nonnull
+ public final Builder denseEmbeddingConfig(
+ Function> fn
+ ) {
+ return denseEmbeddingConfig(fn.apply(new SemanticDenseEmbeddingConfig.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code model_id}
+ */
+ @Nonnull
+ public final Builder modelId(String value) {
+ this.modelId = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code raw_field_type}
+ */
+ @Nonnull
+ public final Builder rawFieldType(@Nullable String value) {
+ this.rawFieldType = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code search_model_id}
+ */
+ @Nonnull
+ public final Builder searchModelId(@Nullable String value) {
+ this.searchModelId = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code semantic_field_search_analyzer}
+ */
+ @Nonnull
+ public final Builder semanticFieldSearchAnalyzer(@Nullable String value) {
+ this.semanticFieldSearchAnalyzer = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code semantic_info_field_name}
+ */
+ @Nonnull
+ public final Builder semanticInfoFieldName(@Nullable String value) {
+ this.semanticInfoFieldName = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code skip_existing_embedding}
+ */
+ @Nonnull
+ public final Builder skipExistingEmbedding(@Nullable Boolean value) {
+ this.skipExistingEmbedding = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code sparse_encoding_config}
+ */
+ @Nonnull
+ public final Builder sparseEncodingConfig(@Nullable SemanticSparseEncodingConfig value) {
+ this.sparseEncodingConfig = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code sparse_encoding_config}
+ */
+ @Nonnull
+ public final Builder sparseEncodingConfig(
+ Function> fn
+ ) {
+ return sparseEncodingConfig(fn.apply(new SemanticSparseEncodingConfig.Builder()).build());
+ }
+
+ /**
+ * Builds a {@link SemanticProperty}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public SemanticProperty build() {
+ _checkSingleUse();
+
+ return new SemanticProperty(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link SemanticProperty}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ SemanticProperty::setupSemanticPropertyDeserializer
+ );
+
+ protected static void setupSemanticPropertyDeserializer(ObjectDeserializer op) {
+ op.add(Builder::chunking, JsonData._DESERIALIZER, "chunking");
+ op.add(Builder::denseEmbeddingConfig, SemanticDenseEmbeddingConfig._DESERIALIZER, "dense_embedding_config");
+ op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id");
+ op.add(Builder::rawFieldType, JsonpDeserializer.stringDeserializer(), "raw_field_type");
+ op.add(Builder::searchModelId, JsonpDeserializer.stringDeserializer(), "search_model_id");
+ op.add(Builder::semanticFieldSearchAnalyzer, JsonpDeserializer.stringDeserializer(), "semantic_field_search_analyzer");
+ op.add(Builder::semanticInfoFieldName, JsonpDeserializer.stringDeserializer(), "semantic_info_field_name");
+ op.add(Builder::skipExistingEmbedding, JsonpDeserializer.booleanDeserializer(), "skip_existing_embedding");
+ op.add(Builder::sparseEncodingConfig, SemanticSparseEncodingConfig._DESERIALIZER, "sparse_encoding_config");
+
+ op.ignore("type");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.chunking);
+ result = 31 * result + Objects.hashCode(this.denseEmbeddingConfig);
+ result = 31 * result + this.modelId.hashCode();
+ result = 31 * result + Objects.hashCode(this.rawFieldType);
+ result = 31 * result + Objects.hashCode(this.searchModelId);
+ result = 31 * result + Objects.hashCode(this.semanticFieldSearchAnalyzer);
+ result = 31 * result + Objects.hashCode(this.semanticInfoFieldName);
+ result = 31 * result + Objects.hashCode(this.skipExistingEmbedding);
+ result = 31 * result + Objects.hashCode(this.sparseEncodingConfig);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ SemanticProperty other = (SemanticProperty) o;
+ return Objects.equals(this.chunking, other.chunking)
+ && Objects.equals(this.denseEmbeddingConfig, other.denseEmbeddingConfig)
+ && this.modelId.equals(other.modelId)
+ && Objects.equals(this.rawFieldType, other.rawFieldType)
+ && Objects.equals(this.searchModelId, other.searchModelId)
+ && Objects.equals(this.semanticFieldSearchAnalyzer, other.semanticFieldSearchAnalyzer)
+ && Objects.equals(this.semanticInfoFieldName, other.semanticInfoFieldName)
+ && Objects.equals(this.skipExistingEmbedding, other.skipExistingEmbedding)
+ && Objects.equals(this.sparseEncodingConfig, other.sparseEncodingConfig);
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/PinnedDoc.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticSparseEncodingConfig.java
similarity index 55%
rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/PinnedDoc.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticSparseEncodingConfig.java
index 0eeae29390..82327989b5 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/PinnedDoc.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SemanticSparseEncodingConfig.java
@@ -34,61 +34,67 @@
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------
-package org.opensearch.client.opensearch._types.query_dsl;
+package org.opensearch.client.opensearch._types.mapping;
import jakarta.json.stream.JsonGenerator;
+import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
-import org.opensearch.client.util.ApiTypeHelper;
import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
import org.opensearch.client.util.ToCopyableBuilder;
-// typedef: _types.query_dsl.PinnedDoc
+// typedef: _types.mapping.SemanticSparseEncodingConfig
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class PinnedDoc implements PlainJsonSerializable, ToCopyableBuilder {
+public class SemanticSparseEncodingConfig
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
- @Nonnull
- private final String id;
+ @Nullable
+ private final Number pruneRatio;
- @Nonnull
- private final String index;
+ @Nullable
+ private final String pruneType;
// ---------------------------------------------------------------------------------------------
- private PinnedDoc(Builder builder) {
- this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
- this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
+ private SemanticSparseEncodingConfig(Builder builder) {
+ this.pruneRatio = builder.pruneRatio;
+ this.pruneType = builder.pruneType;
}
- public static PinnedDoc of(Function> fn) {
+ public static SemanticSparseEncodingConfig of(
+ Function> fn
+ ) {
return fn.apply(new Builder()).build();
}
/**
- * Required - API name: {@code _id}
+ * API name: {@code prune_ratio}
*/
- @Nonnull
- public final String id() {
- return this.id;
+ @Nullable
+ public final Number pruneRatio() {
+ return this.pruneRatio;
}
/**
- * Required - API name: {@code _index}
+ * API name: {@code prune_type}
*/
- @Nonnull
- public final String index() {
- return this.index;
+ @Nullable
+ public final String pruneType() {
+ return this.pruneType;
}
/**
@@ -102,11 +108,15 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
- generator.writeKey("_id");
- generator.write(this.id);
+ if (this.pruneRatio != null) {
+ generator.writeKey("prune_ratio");
+ generator.write(this.pruneRatio.doubleValue());
+ }
- generator.writeKey("_index");
- generator.write(this.index);
+ if (this.pruneType != null) {
+ generator.writeKey("prune_type");
+ generator.write(this.pruneType);
+ }
}
// ---------------------------------------------------------------------------------------------
@@ -123,22 +133,24 @@ public static Builder builder() {
}
/**
- * Builder for {@link PinnedDoc}.
+ * Builder for {@link SemanticSparseEncodingConfig}.
*/
- public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
- private String id;
- private String index;
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Number pruneRatio;
+ @Nullable
+ private String pruneType;
public Builder() {}
- private Builder(PinnedDoc o) {
- this.id = o.id;
- this.index = o.index;
+ private Builder(SemanticSparseEncodingConfig o) {
+ this.pruneRatio = o.pruneRatio;
+ this.pruneType = o.pruneType;
}
private Builder(Builder o) {
- this.id = o.id;
- this.index = o.index;
+ this.pruneRatio = o.pruneRatio;
+ this.pruneType = o.pruneType;
}
@Override
@@ -148,57 +160,57 @@ public Builder copy() {
}
/**
- * Required - API name: {@code _id}
+ * API name: {@code prune_ratio}
*/
@Nonnull
- public final Builder id(String value) {
- this.id = value;
+ public final Builder pruneRatio(@Nullable Number value) {
+ this.pruneRatio = value;
return this;
}
/**
- * Required - API name: {@code _index}
+ * API name: {@code prune_type}
*/
@Nonnull
- public final Builder index(String value) {
- this.index = value;
+ public final Builder pruneType(@Nullable String value) {
+ this.pruneType = value;
return this;
}
/**
- * Builds a {@link PinnedDoc}.
+ * Builds a {@link SemanticSparseEncodingConfig}.
*
* @throws NullPointerException if some of the required fields are null.
*/
@Override
@Nonnull
- public PinnedDoc build() {
+ public SemanticSparseEncodingConfig build() {
_checkSingleUse();
- return new PinnedDoc(this);
+ return new SemanticSparseEncodingConfig(this);
}
}
// ---------------------------------------------------------------------------------------------
/**
- * Json deserializer for {@link PinnedDoc}
+ * Json deserializer for {@link SemanticSparseEncodingConfig}
*/
- public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
Builder::new,
- PinnedDoc::setupPinnedDocDeserializer
+ SemanticSparseEncodingConfig::setupSemanticSparseEncodingConfigDeserializer
);
- protected static void setupPinnedDocDeserializer(ObjectDeserializer op) {
- op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id");
- op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "_index");
+ protected static void setupSemanticSparseEncodingConfigDeserializer(ObjectDeserializer op) {
+ op.add(Builder::pruneRatio, JsonpDeserializer.numberDeserializer(), "prune_ratio");
+ op.add(Builder::pruneType, JsonpDeserializer.stringDeserializer(), "prune_type");
}
@Override
public int hashCode() {
int result = 17;
- result = 31 * result + this.id.hashCode();
- result = 31 * result + this.index.hashCode();
+ result = 31 * result + Objects.hashCode(this.pruneRatio);
+ result = 31 * result + Objects.hashCode(this.pruneType);
return result;
}
@@ -206,7 +218,7 @@ public int hashCode() {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
- PinnedDoc other = (PinnedDoc) o;
- return this.id.equals(other.id) && this.index.equals(other.index);
+ SemanticSparseEncodingConfig other = (SemanticSparseEncodingConfig) o;
+ return Objects.equals(this.pruneRatio, other.pruneRatio) && Objects.equals(this.pruneType, other.pruneType);
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/DecayPlacement.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/DecayPlacement.java
index 1de9a9e14b..17646b90de 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/DecayPlacement.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/DecayPlacement.java
@@ -49,6 +49,7 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.util.ApiTypeHelper;
import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
@@ -69,7 +70,7 @@ public class DecayPlacement implements PlainJsonSerializable, ToCopyableBuilder<
@Nullable
private final JsonData origin;
- @Nullable
+ @Nonnull
private final JsonData scale;
// ---------------------------------------------------------------------------------------------
@@ -78,7 +79,7 @@ private DecayPlacement(Builder builder) {
this.decay = builder.decay;
this.offset = builder.offset;
this.origin = builder.origin;
- this.scale = builder.scale;
+ this.scale = ApiTypeHelper.requireNonNull(builder.scale, this, "scale");
}
public static DecayPlacement of(Function> fn) {
@@ -110,9 +111,9 @@ public final JsonData origin() {
}
/**
- * API name: {@code scale}
+ * Required - API name: {@code scale}
*/
- @Nullable
+ @Nonnull
public final JsonData scale() {
return this.scale;
}
@@ -143,10 +144,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.origin.serialize(generator, mapper);
}
- if (this.scale != null) {
- generator.writeKey("scale");
- this.scale.serialize(generator, mapper);
- }
+ generator.writeKey("scale");
+ this.scale.serialize(generator, mapper);
}
// ---------------------------------------------------------------------------------------------
@@ -172,7 +171,6 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
private JsonData offset;
@Nullable
private JsonData origin;
- @Nullable
private JsonData scale;
public Builder() {}
@@ -225,10 +223,10 @@ public final Builder origin(@Nullable JsonData value) {
}
/**
- * API name: {@code scale}
+ * Required - API name: {@code scale}
*/
@Nonnull
- public final Builder scale(@Nullable JsonData value) {
+ public final Builder scale(JsonData value) {
this.scale = value;
return this;
}
@@ -270,7 +268,7 @@ public int hashCode() {
result = 31 * result + Objects.hashCode(this.decay);
result = 31 * result + Objects.hashCode(this.offset);
result = 31 * result + Objects.hashCode(this.origin);
- result = 31 * result + Objects.hashCode(this.scale);
+ result = 31 * result + this.scale.hashCode();
return result;
}
@@ -282,6 +280,6 @@ public boolean equals(Object o) {
return Objects.equals(this.decay, other.decay)
&& Objects.equals(this.offset, other.offset)
&& Objects.equals(this.origin, other.origin)
- && Objects.equals(this.scale, other.scale);
+ && this.scale.equals(other.scale);
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/FieldAndFormat.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/FieldAndFormat.java
index 29540f8862..0253f2d4a6 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/FieldAndFormat.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/FieldAndFormat.java
@@ -66,15 +66,11 @@ public class FieldAndFormat implements PlainJsonSerializable, ToCopyableBuilder<
@Nullable
private final String format;
- @Nullable
- private final Boolean includeUnmapped;
-
// ---------------------------------------------------------------------------------------------
private FieldAndFormat(Builder builder) {
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
this.format = builder.format;
- this.includeUnmapped = builder.includeUnmapped;
}
public static FieldAndFormat of(Function> fn) {
@@ -100,14 +96,6 @@ public final String format() {
return this.format;
}
- /**
- * API name: {@code include_unmapped}
- */
- @Nullable
- public final Boolean includeUnmapped() {
- return this.includeUnmapped;
- }
-
/**
* Serialize this object to JSON.
*/
@@ -126,11 +114,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("format");
generator.write(this.format);
}
-
- if (this.includeUnmapped != null) {
- generator.writeKey("include_unmapped");
- generator.write(this.includeUnmapped);
- }
}
// ---------------------------------------------------------------------------------------------
@@ -153,21 +136,17 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
private String field;
@Nullable
private String format;
- @Nullable
- private Boolean includeUnmapped;
public Builder() {}
private Builder(FieldAndFormat o) {
this.field = o.field;
this.format = o.format;
- this.includeUnmapped = o.includeUnmapped;
}
private Builder(Builder o) {
this.field = o.field;
this.format = o.format;
- this.includeUnmapped = o.includeUnmapped;
}
@Override
@@ -197,15 +176,6 @@ public final Builder format(@Nullable String value) {
return this;
}
- /**
- * API name: {@code include_unmapped}
- */
- @Nonnull
- public final Builder includeUnmapped(@Nullable Boolean value) {
- this.includeUnmapped = value;
- return this;
- }
-
/**
* Builds a {@link FieldAndFormat}.
*
@@ -233,7 +203,6 @@ public FieldAndFormat build() {
protected static void setupFieldAndFormatDeserializer(ObjectDeserializer op) {
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format");
- op.add(Builder::includeUnmapped, JsonpDeserializer.booleanDeserializer(), "include_unmapped");
op.shortcutProperty("field");
}
@@ -243,7 +212,6 @@ public int hashCode() {
int result = 17;
result = 31 * result + this.field.hashCode();
result = 31 * result + Objects.hashCode(this.format);
- result = 31 * result + Objects.hashCode(this.includeUnmapped);
return result;
}
@@ -252,8 +220,6 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
FieldAndFormat other = (FieldAndFormat) o;
- return this.field.equals(other.field)
- && Objects.equals(this.format, other.format)
- && Objects.equals(this.includeUnmapped, other.includeUnmapped);
+ return this.field.equals(other.field) && Objects.equals(this.format, other.format);
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/GeoDistanceQuery.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/GeoDistanceQuery.java
index dd9dd1ff59..e7f0227ebd 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/GeoDistanceQuery.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/GeoDistanceQuery.java
@@ -47,6 +47,7 @@
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.opensearch._types.DistanceUnit;
import org.opensearch.client.opensearch._types.GeoDistanceType;
import org.opensearch.client.opensearch._types.GeoLocation;
import org.opensearch.client.util.ApiTypeHelper;
@@ -75,6 +76,9 @@ public class GeoDistanceQuery extends QueryBase implements QueryVariant, ToCopya
@Nonnull
private final GeoLocation location;
+ @Nullable
+ private final DistanceUnit unit;
+
@Nullable
private final GeoValidationMethod validationMethod;
@@ -87,6 +91,7 @@ private GeoDistanceQuery(Builder builder) {
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
this.ignoreUnmapped = builder.ignoreUnmapped;
this.location = ApiTypeHelper.requireNonNull(builder.location, this, "location");
+ this.unit = builder.unit;
this.validationMethod = builder.validationMethod;
}
@@ -151,6 +156,17 @@ public final GeoLocation location() {
return this.location;
}
+ /**
+ * The unit of distance measurement.
+ *
+ * API name: {@code unit}
+ *
+ */
+ @Nullable
+ public final DistanceUnit unit() {
+ return this.unit;
+ }
+
/**
* API name: {@code validation_method}
*/
@@ -176,6 +192,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write(this.ignoreUnmapped);
}
+ if (this.unit != null) {
+ generator.writeKey("unit");
+ this.unit.serialize(generator, mapper);
+ }
+
if (this.validationMethod != null) {
generator.writeKey("validation_method");
this.validationMethod.serialize(generator, mapper);
@@ -207,6 +228,8 @@ public static class Builder extends QueryBase.AbstractBuilder implement
private Boolean ignoreUnmapped;
private GeoLocation location;
@Nullable
+ private DistanceUnit unit;
+ @Nullable
private GeoValidationMethod validationMethod;
public Builder() {}
@@ -218,6 +241,7 @@ private Builder(GeoDistanceQuery o) {
this.field = o.field;
this.ignoreUnmapped = o.ignoreUnmapped;
this.location = o.location;
+ this.unit = o.unit;
this.validationMethod = o.validationMethod;
}
@@ -228,6 +252,7 @@ private Builder(Builder o) {
this.field = o.field;
this.ignoreUnmapped = o.ignoreUnmapped;
this.location = o.location;
+ this.unit = o.unit;
this.validationMethod = o.validationMethod;
}
@@ -314,6 +339,18 @@ public final Builder location(Function
+ * API name: {@code unit}
+ *
+ */
+ @Nonnull
+ public final Builder unit(@Nullable DistanceUnit value) {
+ this.unit = value;
+ return this;
+ }
+
/**
* API name: {@code validation_method}
*/
@@ -352,6 +389,7 @@ protected static void setupGeoDistanceQueryDeserializer(ObjectDeserializer {
builder.field(name);
@@ -367,6 +405,7 @@ public int hashCode() {
result = 31 * result + this.field.hashCode();
result = 31 * result + Objects.hashCode(this.ignoreUnmapped);
result = 31 * result + this.location.hashCode();
+ result = 31 * result + Objects.hashCode(this.unit);
result = 31 * result + Objects.hashCode(this.validationMethod);
return result;
}
@@ -384,6 +423,7 @@ public boolean equals(Object o) {
&& this.field.equals(other.field)
&& Objects.equals(this.ignoreUnmapped, other.ignoreUnmapped)
&& this.location.equals(other.location)
+ && Objects.equals(this.unit, other.unit)
&& Objects.equals(this.validationMethod, other.validationMethod);
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/HybridQuery.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/HybridQuery.java
index 97fa40eccb..f540c00fea 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/HybridQuery.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/HybridQuery.java
@@ -59,6 +59,9 @@
@Generated("org.opensearch.client.codegen.CodeGenerator")
public class HybridQuery extends QueryBase implements QueryVariant, ToCopyableBuilder {
+ @Nullable
+ private final Query filter;
+
@Nullable
private final Integer paginationDepth;
@@ -69,6 +72,7 @@ public class HybridQuery extends QueryBase implements QueryVariant, ToCopyableBu
private HybridQuery(Builder builder) {
super(builder);
+ this.filter = builder.filter;
this.paginationDepth = builder.paginationDepth;
this.queries = ApiTypeHelper.unmodifiable(builder.queries);
}
@@ -85,6 +89,14 @@ public Query.Kind _queryKind() {
return Query.Kind.Hybrid;
}
+ /**
+ * API name: {@code filter}
+ */
+ @Nullable
+ public final Query filter() {
+ return this.filter;
+ }
+
/**
* API name: {@code pagination_depth}
*/
@@ -103,6 +115,11 @@ public final List queries() {
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
super.serializeInternal(generator, mapper);
+ if (this.filter != null) {
+ generator.writeKey("filter");
+ this.filter.serialize(generator, mapper);
+ }
+
if (this.paginationDepth != null) {
generator.writeKey("pagination_depth");
generator.write(this.paginationDepth);
@@ -135,6 +152,8 @@ public static Builder builder() {
* Builder for {@link HybridQuery}.
*/
public static class Builder extends QueryBase.AbstractBuilder implements CopyableBuilder {
+ @Nullable
+ private Query filter;
@Nullable
private Integer paginationDepth;
@Nullable
@@ -144,12 +163,14 @@ public Builder() {}
private Builder(HybridQuery o) {
super(o);
+ this.filter = o.filter;
this.paginationDepth = o.paginationDepth;
this.queries = _listCopy(o.queries);
}
private Builder(Builder o) {
super(o);
+ this.filter = o.filter;
this.paginationDepth = o.paginationDepth;
this.queries = _listCopy(o.queries);
}
@@ -166,6 +187,23 @@ protected Builder self() {
return this;
}
+ /**
+ * API name: {@code filter}
+ */
+ @Nonnull
+ public final Builder filter(@Nullable Query value) {
+ this.filter = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code filter}
+ */
+ @Nonnull
+ public final Builder filter(Function> fn) {
+ return filter(fn.apply(new Query.Builder()).build());
+ }
+
/**
* API name: {@code pagination_depth}
*/
@@ -239,6 +277,7 @@ public HybridQuery build() {
protected static void setupHybridQueryDeserializer(ObjectDeserializer op) {
setupQueryBaseDeserializer(op);
+ op.add(Builder::filter, Query._DESERIALIZER, "filter");
op.add(Builder::paginationDepth, JsonpDeserializer.integerDeserializer(), "pagination_depth");
op.add(Builder::queries, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "queries");
}
@@ -246,6 +285,7 @@ protected static void setupHybridQueryDeserializer(ObjectDeserializer, QueryVariant, PlainJsonSerializable {
- /**
- * {@link PinnedQuery} variant kinds.
- */
- public enum Kind implements JsonEnum {
- Docs("docs"),
- Ids("ids");
-
- private final String jsonValue;
-
- Kind(String jsonValue) {
- this.jsonValue = jsonValue;
- }
-
- @Override
- public String jsonValue() {
- return jsonValue;
- }
- }
-
- /**
- * {@link Query} variant kind.
- */
- @Override
- public Query.Kind _queryKind() {
- return Query.Kind.Pinned;
- }
-
- private final Kind _kind;
- private final Object _value;
-
- @Override
- public final Kind _kind() {
- return _kind;
- }
-
- @Override
- public final Object _get() {
- return _value;
- }
-
- @Nonnull
- private final Query organic;
-
- private PinnedQuery(Builder builder) {
- super(builder);
- this.organic = ApiTypeHelper.requireNonNull(builder.organic, this, "organic");
- this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, "");
- this._value = ApiTypeHelper.requireNonNull(builder._value, builder, "");
- }
-
- public static PinnedQuery of(Function> fn) {
- return fn.apply(new Builder()).build();
- }
-
- /**
- * Required - API name: {@code organic}
- */
- @Nonnull
- public final Query organic() {
- return this.organic;
- }
-
- /**
- * Is this variant instance of kind {@code docs}?
- */
- public boolean isDocs() {
- return _kind == Kind.Docs;
- }
-
- /**
- * Get the {@code docs} variant value.
- *
- * @throws IllegalStateException if the current variant is not the {@code docs} kind.
- */
- public List docs() {
- return TaggedUnionUtils.get(this, Kind.Docs);
- }
-
- /**
- * Is this variant instance of kind {@code ids}?
- */
- public boolean isIds() {
- return _kind == Kind.Ids;
- }
-
- /**
- * Get the {@code ids} variant value.
- *
- * @throws IllegalStateException if the current variant is not the {@code ids} kind.
- */
- public List ids() {
- return TaggedUnionUtils.get(this, Kind.Ids);
- }
-
- @Override
- public void serialize(JsonGenerator generator, JsonpMapper mapper) {
- generator.writeStartObject();
- super.serializeInternal(generator, mapper);
- generator.writeKey("organic");
- this.organic.serialize(generator, mapper);
- generator.writeKey(_kind.jsonValue());
- if (_value instanceof JsonpSerializable) {
- ((JsonpSerializable) _value).serialize(generator, mapper);
- } else {
- switch (_kind) {
- case Docs:
- generator.writeStartArray();
- for (PinnedDoc item0 : ((List) this._value)) {
- item0.serialize(generator, mapper);
- }
- generator.writeEnd();
- break;
- case Ids:
- generator.writeStartArray();
- for (String item0 : ((List) this._value)) {
- generator.write(item0);
- }
- generator.writeEnd();
- break;
- }
- }
- generator.writeEnd();
- }
-
- @Nonnull
- public Builder toBuilder() {
- return new Builder(this);
- }
-
- @Nonnull
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder extends QueryBase.AbstractBuilder {
- private Kind _kind;
- private Object _value;
- private Query organic;
-
- public Builder() {}
-
- private Builder(PinnedQuery o) {
- super(o);
- this.organic = o.organic;
- this._kind = o._kind;
- this._value = o._value;
- }
-
- @Override
- @Nonnull
- protected Builder self() {
- return this;
- }
-
- /**
- * Required - API name: {@code organic}
- */
- @Nonnull
- public final Builder organic(Query value) {
- this.organic = value;
- return this;
- }
-
- /**
- * Required - API name: {@code organic}
- */
- @Nonnull
- public final Builder organic(Function> fn) {
- return organic(fn.apply(new Query.Builder()).build());
- }
-
- public ContainerBuilder docs(List v) {
- this._kind = Kind.Docs;
- this._value = v;
- return new ContainerBuilder();
- }
-
- public ContainerBuilder ids(List v) {
- this._kind = Kind.Ids;
- this._value = v;
- return new ContainerBuilder();
- }
-
- protected PinnedQuery build() {
- _checkSingleUse();
- return new PinnedQuery(this);
- }
-
- public class ContainerBuilder implements ObjectBuilder {
- private ContainerBuilder() {}
-
- /**
- * Required - API name: {@code organic}
- */
- @Nonnull
- public final ContainerBuilder organic(Query value) {
- Builder.this.organic = value;
- return this;
- }
-
- /**
- * Required - API name: {@code organic}
- */
- @Nonnull
- public final ContainerBuilder organic(Function> fn) {
- return organic(fn.apply(new Query.Builder()).build());
- }
-
- @Override
- public PinnedQuery build() {
- return Builder.this.build();
- }
- }
- }
-
- protected static void setupPinnedQueryDeserializer(ObjectDeserializer op) {
- setupQueryBaseDeserializer(op);
- op.add(Builder::organic, Query._DESERIALIZER, "organic");
- op.add(Builder::docs, JsonpDeserializer.arrayDeserializer(PinnedDoc._DESERIALIZER), "docs");
- op.add(Builder::ids, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "ids");
- }
-
- public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
- Builder::new,
- PinnedQuery::setupPinnedQueryDeserializer,
- Builder::build
- );
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = 31 * result + Objects.hashCode(this._kind);
- result = 31 * result + Objects.hashCode(this._value);
- result = 31 * result + this.organic.hashCode();
- return result;
- }
-
- @Override
- public boolean equals(Object o) {
- if (!super.equals(o)) {
- return false;
- }
- if (this == o) return true;
- if (o == null || this.getClass() != o.getClass()) return false;
- PinnedQuery other = (PinnedQuery) o;
- return Objects.equals(this._kind, other._kind) && Objects.equals(this._value, other._value) && this.organic.equals(other.organic);
- }
-}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java
index 296d9c7f02..6186db7e45 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java
@@ -101,7 +101,6 @@ public enum Kind implements JsonEnum {
Neural("neural"),
ParentId("parent_id"),
Percolate("percolate"),
- Pinned("pinned"),
Prefix("prefix"),
QueryString("query_string"),
Range("range"),
@@ -702,22 +701,6 @@ public PercolateQuery percolate() {
return TaggedUnionUtils.get(this, Kind.Percolate);
}
- /**
- * Is this variant instance of kind {@code pinned}?
- */
- public boolean isPinned() {
- return _kind == Kind.Pinned;
- }
-
- /**
- * Get the {@code pinned} variant value.
- *
- * @throws IllegalStateException if the current variant is not the {@code pinned} kind.
- */
- public PinnedQuery pinned() {
- return TaggedUnionUtils.get(this, Kind.Pinned);
- }
-
/**
* Is this variant instance of kind {@code prefix}?
*/
@@ -1474,16 +1457,6 @@ public ObjectBuilder percolate(Function pinned(PinnedQuery v) {
- this._kind = Kind.Pinned;
- this._value = v;
- return this;
- }
-
- public ObjectBuilder pinned(Function> fn) {
- return this.pinned(fn.apply(new PinnedQuery.Builder()).build());
- }
-
public ObjectBuilder prefix(PrefixQuery v) {
this._kind = Kind.Prefix;
this._value = v;
@@ -1761,7 +1734,6 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) {
op.add(Builder::neural, NeuralQuery._DESERIALIZER, "neural");
op.add(Builder::parentId, ParentIdQuery._DESERIALIZER, "parent_id");
op.add(Builder::percolate, PercolateQuery._DESERIALIZER, "percolate");
- op.add(Builder::pinned, PinnedQuery._DESERIALIZER, "pinned");
op.add(Builder::prefix, PrefixQuery._DESERIALIZER, "prefix");
op.add(Builder::queryString, QueryStringQuery._DESERIALIZER, "query_string");
op.add(Builder::range, RangeQuery._DESERIALIZER, "range");
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/QueryBuilders.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/QueryBuilders.java
index 0950108aeb..ae3c17b27d 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/QueryBuilders.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/QueryBuilders.java
@@ -281,13 +281,6 @@ public static PercolateQuery.Builder percolate() {
return new PercolateQuery.Builder();
}
- /**
- * Creates a builder for the {@link PinnedQuery pinned} {@code Query} variant.
- */
- public static PinnedQuery.Builder pinned() {
- return new PinnedQuery.Builder();
- }
-
/**
* Creates a builder for the {@link PrefixQuery prefix} {@code Query} variant.
*/
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/RangeQuery.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/RangeQuery.java
index e8e6cb6aa8..5394f9f086 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/RangeQuery.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/RangeQuery.java
@@ -79,6 +79,12 @@ public class RangeQuery implements QueryVariant, PlainJsonSerializable, ToCopyab
@Nullable
private final JsonData gte;
+ @Nullable
+ private final Boolean includeLower;
+
+ @Nullable
+ private final Boolean includeUpper;
+
@Nullable
private final JsonData lt;
@@ -106,6 +112,8 @@ private RangeQuery(Builder builder) {
this.from = builder.from;
this.gt = builder.gt;
this.gte = builder.gte;
+ this.includeLower = builder.includeLower;
+ this.includeUpper = builder.includeUpper;
this.lt = builder.lt;
this.lte = builder.lte;
this.name = builder.name;
@@ -174,6 +182,22 @@ public final JsonData gte() {
return this.gte;
}
+ /**
+ * API name: {@code include_lower}
+ */
+ @Nullable
+ public final Boolean includeLower() {
+ return this.includeLower;
+ }
+
+ /**
+ * API name: {@code include_upper}
+ */
+ @Nullable
+ public final Boolean includeUpper() {
+ return this.includeUpper;
+ }
+
/**
* API name: {@code lt}
*/
@@ -259,6 +283,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.gte.serialize(generator, mapper);
}
+ if (this.includeLower != null) {
+ generator.writeKey("include_lower");
+ generator.write(this.includeLower);
+ }
+
+ if (this.includeUpper != null) {
+ generator.writeKey("include_upper");
+ generator.write(this.includeUpper);
+ }
+
if (this.lt != null) {
generator.writeKey("lt");
this.lt.serialize(generator, mapper);
@@ -320,6 +354,10 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
@Nullable
private JsonData gte;
@Nullable
+ private Boolean includeLower;
+ @Nullable
+ private Boolean includeUpper;
+ @Nullable
private JsonData lt;
@Nullable
private JsonData lte;
@@ -341,6 +379,8 @@ private Builder(RangeQuery o) {
this.from = o.from;
this.gt = o.gt;
this.gte = o.gte;
+ this.includeLower = o.includeLower;
+ this.includeUpper = o.includeUpper;
this.lt = o.lt;
this.lte = o.lte;
this.name = o.name;
@@ -356,6 +396,8 @@ private Builder(Builder o) {
this.from = o.from;
this.gt = o.gt;
this.gte = o.gte;
+ this.includeLower = o.includeLower;
+ this.includeUpper = o.includeUpper;
this.lt = o.lt;
this.lte = o.lte;
this.name = o.name;
@@ -424,6 +466,24 @@ public final Builder gte(@Nullable JsonData value) {
return this;
}
+ /**
+ * API name: {@code include_lower}
+ */
+ @Nonnull
+ public final Builder includeLower(@Nullable Boolean value) {
+ this.includeLower = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code include_upper}
+ */
+ @Nonnull
+ public final Builder includeUpper(@Nullable Boolean value) {
+ this.includeUpper = value;
+ return this;
+ }
+
/**
* API name: {@code lt}
*/
@@ -508,6 +568,8 @@ protected static void setupRangeQueryDeserializer(ObjectDeserializer {
+public class TermsQuery implements QueryVariant, PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nullable
+ private final Float boost;
@Nonnull
private final String field;
+ @Nullable
+ private final String name;
+
@Nonnull
private final TermsQueryField terms;
@@ -70,8 +78,9 @@ public class TermsQuery extends QueryBase implements QueryVariant, ToCopyableBui
// ---------------------------------------------------------------------------------------------
private TermsQuery(Builder builder) {
- super(builder);
+ this.boost = builder.boost;
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
+ this.name = builder.name;
this.terms = ApiTypeHelper.requireNonNull(builder.terms, this, "terms");
this.valueType = builder.valueType;
}
@@ -88,6 +97,14 @@ public Query.Kind _queryKind() {
return Query.Kind.Terms;
}
+ /**
+ * API name: {@code boost}
+ */
+ @Nullable
+ public final Float boost() {
+ return this.boost;
+ }
+
/**
* Required -
*/
@@ -96,6 +113,14 @@ public final String field() {
return this.field;
}
+ /**
+ * API name: {@code _name}
+ */
+ @Nullable
+ public final String name() {
+ return this.name;
+ }
+
/**
* Required -
*/
@@ -116,10 +141,29 @@ public final TermsQueryValueType valueType() {
return this.valueType;
}
+ /**
+ * Serialize this object to JSON.
+ */
+ @Override
+ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeStartObject();
+ serializeInternal(generator, mapper);
+ generator.writeEnd();
+ }
+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
- super.serializeInternal(generator, mapper);
generator.writeKey(this.field);
this.terms.serialize(generator, mapper);
+ if (this.boost != null) {
+ generator.writeKey("boost");
+ generator.write(this.boost);
+ }
+
+ if (this.name != null) {
+ generator.writeKey("_name");
+ generator.write(this.name);
+ }
+
if (this.valueType != null) {
generator.writeKey("value_type");
this.valueType.serialize(generator, mapper);
@@ -142,8 +186,12 @@ public static Builder builder() {
/**
* Builder for {@link TermsQuery}.
*/
- public static class Builder extends QueryBase.AbstractBuilder implements CopyableBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Float boost;
private String field;
+ @Nullable
+ private String name;
private TermsQueryField terms;
@Nullable
private TermsQueryValueType valueType;
@@ -151,15 +199,17 @@ public static class Builder extends QueryBase.AbstractBuilder implement
public Builder() {}
private Builder(TermsQuery o) {
- super(o);
+ this.boost = o.boost;
this.field = o.field;
+ this.name = o.name;
this.terms = o.terms;
this.valueType = o.valueType;
}
private Builder(Builder o) {
- super(o);
+ this.boost = o.boost;
this.field = o.field;
+ this.name = o.name;
this.terms = o.terms;
this.valueType = o.valueType;
}
@@ -170,9 +220,12 @@ public Builder copy() {
return new Builder(this);
}
- @Override
+ /**
+ * API name: {@code boost}
+ */
@Nonnull
- protected Builder self() {
+ public final Builder boost(@Nullable Float value) {
+ this.boost = value;
return this;
}
@@ -185,6 +238,15 @@ public final Builder field(String value) {
return this;
}
+ /**
+ * API name: {@code _name}
+ */
+ @Nonnull
+ public final Builder name(@Nullable String value) {
+ this.name = value;
+ return this;
+ }
+
/**
* Required -
*/
@@ -240,7 +302,8 @@ public TermsQuery build() {
);
protected static void setupTermsQueryDeserializer(ObjectDeserializer op) {
- setupQueryBaseDeserializer(op);
+ op.add(Builder::boost, JsonpDeserializer.floatDeserializer(), "boost");
+ op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "_name");
op.add(Builder::valueType, TermsQueryValueType._DESERIALIZER, "value_type");
op.setUnknownFieldHandler((builder, name, parser, mapper) -> {
builder.field(name);
@@ -250,8 +313,10 @@ protected static void setupTermsQueryDeserializer(ObjectDeserializer derived;
+
@Nullable
private final String df;
@@ -215,6 +219,9 @@ public final class SearchRequest extends RequestBase
@Nonnull
private final List searchAfter;
+ @Nullable
+ private final String searchPipeline;
+
@Nullable
private final SearchType searchType;
@@ -274,6 +281,7 @@ private SearchRequest(Builder builder) {
this.ccsMinimizeRoundtrips = builder.ccsMinimizeRoundtrips;
this.collapse = builder.collapse;
this.defaultOperator = builder.defaultOperator;
+ this.derived = ApiTypeHelper.unmodifiable(builder.derived);
this.df = builder.df;
this.docvalueFields = ApiTypeHelper.unmodifiable(builder.docvalueFields);
this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards);
@@ -305,6 +313,7 @@ private SearchRequest(Builder builder) {
this.scriptFields = ApiTypeHelper.unmodifiable(builder.scriptFields);
this.scroll = builder.scroll;
this.searchAfter = ApiTypeHelper.unmodifiable(builder.searchAfter);
+ this.searchPipeline = builder.searchPipeline;
this.searchType = builder.searchType;
this.seqNoPrimaryTerm = builder.seqNoPrimaryTerm;
this.size = builder.size;
@@ -441,6 +450,14 @@ public final Operator defaultOperator() {
return this.defaultOperator;
}
+ /**
+ * API name: {@code derived}
+ */
+ @Nonnull
+ public final Map derived() {
+ return this.derived;
+ }
+
/**
* Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string
* parameter is specified.
@@ -554,8 +571,7 @@ public final Boolean ignoreUnavailable() {
}
/**
- * Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated
- * with its score (true) or as an array containing the name of the matched queries (false)
+ * Whether to return scores with named queries. Default is false.
*
* API name: {@code include_named_queries_score}
*
@@ -796,6 +812,17 @@ public final List searchAfter() {
return this.searchAfter;
}
+ /**
+ * Customizable sequence of processing stages applied to search queries.
+ *
+ * API name: {@code search_pipeline}
+ *
+ */
+ @Nullable
+ public final String searchPipeline() {
+ return this.searchPipeline;
+ }
+
/**
* How distributed term frequencies are calculated for relevance scoring.
*
@@ -928,10 +955,7 @@ public final TrackHits trackTotalHits() {
}
/**
- * Enables or disables verbose mode for the search pipeline. When verbose mode is enabled, detailed information about each processor in
- * the search pipeline is included in the search response. This includes the processor name, execution status, input, output, and time
- * taken for processing. This parameter is primarily intended for debugging purposes, allowing users to track how data flows and
- * transforms through the search pipeline.
+ * Enables or disables verbose mode for the search pipeline.
*
* API name: {@code verbose_pipeline}
*
@@ -978,6 +1002,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.collapse.serialize(generator, mapper);
}
+ if (ApiTypeHelper.isDefined(this.derived)) {
+ generator.writeKey("derived");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.derived.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
+ generator.writeEnd();
+ }
+
if (ApiTypeHelper.isDefined(this.docvalueFields)) {
generator.writeKey("docvalue_fields");
generator.writeStartArray();
@@ -1021,6 +1055,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.highlight.serialize(generator, mapper);
}
+ if (this.includeNamedQueriesScore != null) {
+ generator.writeKey("include_named_queries_score");
+ generator.write(this.includeNamedQueriesScore);
+ }
+
if (ApiTypeHelper.isDefined(this.indicesBoost)) {
generator.writeKey("indices_boost");
generator.writeStartArray();
@@ -1090,6 +1129,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeEnd();
}
+ if (this.searchPipeline != null) {
+ generator.writeKey("search_pipeline");
+ generator.write(this.searchPipeline);
+ }
+
if (this.seqNoPrimaryTerm != null) {
generator.writeKey("seq_no_primary_term");
generator.write(this.seqNoPrimaryTerm);
@@ -1162,6 +1206,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.trackTotalHits.serialize(generator, mapper);
}
+ if (this.verbosePipeline != null) {
+ generator.writeKey("verbose_pipeline");
+ generator.write(this.verbosePipeline);
+ }
+
if (this.version != null) {
generator.writeKey("version");
generator.write(this.version);
@@ -1206,6 +1255,8 @@ public static class Builder extends RequestBase.AbstractBuilder impleme
@Nullable
private Operator defaultOperator;
@Nullable
+ private Map derived;
+ @Nullable
private String df;
@Nullable
private List docvalueFields;
@@ -1268,6 +1319,8 @@ public static class Builder extends RequestBase.AbstractBuilder impleme
@Nullable
private List searchAfter;
@Nullable
+ private String searchPipeline;
+ @Nullable
private SearchType searchType;
@Nullable
private Boolean seqNoPrimaryTerm;
@@ -1312,6 +1365,7 @@ private Builder(SearchRequest o) {
this.ccsMinimizeRoundtrips = o.ccsMinimizeRoundtrips;
this.collapse = o.collapse;
this.defaultOperator = o.defaultOperator;
+ this.derived = _mapCopy(o.derived);
this.df = o.df;
this.docvalueFields = _listCopy(o.docvalueFields);
this.expandWildcards = _listCopy(o.expandWildcards);
@@ -1343,6 +1397,7 @@ private Builder(SearchRequest o) {
this.scriptFields = _mapCopy(o.scriptFields);
this.scroll = o.scroll;
this.searchAfter = _listCopy(o.searchAfter);
+ this.searchPipeline = o.searchPipeline;
this.searchType = o.searchType;
this.seqNoPrimaryTerm = o.seqNoPrimaryTerm;
this.size = o.size;
@@ -1372,6 +1427,7 @@ private Builder(Builder o) {
this.ccsMinimizeRoundtrips = o.ccsMinimizeRoundtrips;
this.collapse = o.collapse;
this.defaultOperator = o.defaultOperator;
+ this.derived = _mapCopy(o.derived);
this.df = o.df;
this.docvalueFields = _listCopy(o.docvalueFields);
this.expandWildcards = _listCopy(o.expandWildcards);
@@ -1403,6 +1459,7 @@ private Builder(Builder o) {
this.scriptFields = _mapCopy(o.scriptFields);
this.scroll = o.scroll;
this.searchAfter = _listCopy(o.searchAfter);
+ this.searchPipeline = o.searchPipeline;
this.searchType = o.searchType;
this.seqNoPrimaryTerm = o.seqNoPrimaryTerm;
this.size = o.size;
@@ -1613,6 +1670,44 @@ public final Builder defaultOperator(@Nullable Operator value) {
return this;
}
+ /**
+ * API name: {@code derived}
+ *
+ *
+ * Adds all elements of map to derived.
+ *
+ */
+ @Nonnull
+ public final Builder derived(Map map) {
+ this.derived = _mapPutAll(this.derived, map);
+ return this;
+ }
+
+ /**
+ * API name: {@code derived}
+ *
+ *
+ * Adds an entry to derived.
+ *
+ */
+ @Nonnull
+ public final Builder derived(String key, DerivedField value) {
+ this.derived = _mapPut(this.derived, key, value);
+ return this;
+ }
+
+ /**
+ * API name: {@code derived}
+ *
+ *
+ * Adds a value to derived using a builder lambda.
+ *
+ */
+ @Nonnull
+ public final Builder derived(String key, Function> fn) {
+ return derived(key, fn.apply(new DerivedField.Builder()).build());
+ }
+
/**
* Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query
* string parameter is specified.
@@ -1859,8 +1954,7 @@ public final Builder ignoreUnavailable(@Nullable Boolean value) {
}
/**
- * Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query
- * associated with its score (true) or as an array containing the name of the matched queries (false)
+ * Whether to return scores with named queries. Default is false.
*
* API name: {@code include_named_queries_score}
*
@@ -2320,6 +2414,18 @@ public final Builder searchAfter(Function
+ * API name: {@code search_pipeline}
+ *
+ */
+ @Nonnull
+ public final Builder searchPipeline(@Nullable String value) {
+ this.searchPipeline = value;
+ return this;
+ }
+
/**
* How distributed term frequencies are calculated for relevance scoring.
*
@@ -2565,10 +2671,7 @@ public final Builder trackTotalHits(Function
* API name: {@code verbose_pipeline}
*
@@ -2618,12 +2721,14 @@ public SearchRequest build() {
protected static void setupSearchRequestDeserializer(ObjectDeserializer op) {
op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggregations", "aggs");
op.add(Builder::collapse, FieldCollapse._DESERIALIZER, "collapse");
+ op.add(Builder::derived, JsonpDeserializer.stringMapDeserializer(DerivedField._DESERIALIZER), "derived");
op.add(Builder::docvalueFields, JsonpDeserializer.arrayDeserializer(FieldAndFormat._DESERIALIZER), "docvalue_fields");
op.add(Builder::explain, JsonpDeserializer.booleanDeserializer(), "explain");
op.add(Builder::ext, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "ext");
op.add(Builder::fields, JsonpDeserializer.arrayDeserializer(FieldAndFormat._DESERIALIZER), "fields");
op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from");
op.add(Builder::highlight, Highlight._DESERIALIZER, "highlight");
+ op.add(Builder::includeNamedQueriesScore, JsonpDeserializer.booleanDeserializer(), "include_named_queries_score");
op.add(
Builder::indicesBoost,
JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.floatDeserializer())),
@@ -2637,6 +2742,7 @@ protected static void setupSearchRequestDeserializer(ObjectDeserializer params) {
if (this.ignoreUnavailable != null) {
params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable));
}
- if (this.includeNamedQueriesScore != null) {
- params.put("include_named_queries_score", String.valueOf(this.includeNamedQueriesScore));
- }
if (this.lenient != null) {
params.put("lenient", String.valueOf(this.lenient));
}
@@ -2730,9 +2834,6 @@ protected void applyQueryParameters(@Nonnull Map params) {
if (this.searchType != null) {
params.put("search_type", this.searchType.jsonValue());
}
- if (this.verbosePipeline != null) {
- params.put("verbose_pipeline", String.valueOf(this.verbosePipeline));
- }
}
/**
@@ -2795,6 +2896,7 @@ public int hashCode() {
result = 31 * result + Objects.hashCode(this.ccsMinimizeRoundtrips);
result = 31 * result + Objects.hashCode(this.collapse);
result = 31 * result + Objects.hashCode(this.defaultOperator);
+ result = 31 * result + Objects.hashCode(this.derived);
result = 31 * result + Objects.hashCode(this.df);
result = 31 * result + Objects.hashCode(this.docvalueFields);
result = 31 * result + Objects.hashCode(this.expandWildcards);
@@ -2826,6 +2928,7 @@ public int hashCode() {
result = 31 * result + Objects.hashCode(this.scriptFields);
result = 31 * result + Objects.hashCode(this.scroll);
result = 31 * result + Objects.hashCode(this.searchAfter);
+ result = 31 * result + Objects.hashCode(this.searchPipeline);
result = 31 * result + Objects.hashCode(this.searchType);
result = 31 * result + Objects.hashCode(this.seqNoPrimaryTerm);
result = 31 * result + Objects.hashCode(this.size);
@@ -2859,6 +2962,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.ccsMinimizeRoundtrips, other.ccsMinimizeRoundtrips)
&& Objects.equals(this.collapse, other.collapse)
&& Objects.equals(this.defaultOperator, other.defaultOperator)
+ && Objects.equals(this.derived, other.derived)
&& Objects.equals(this.df, other.df)
&& Objects.equals(this.docvalueFields, other.docvalueFields)
&& Objects.equals(this.expandWildcards, other.expandWildcards)
@@ -2890,6 +2994,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.scriptFields, other.scriptFields)
&& Objects.equals(this.scroll, other.scroll)
&& Objects.equals(this.searchAfter, other.searchAfter)
+ && Objects.equals(this.searchPipeline, other.searchPipeline)
&& Objects.equals(this.searchType, other.searchType)
&& Objects.equals(this.seqNoPrimaryTerm, other.seqNoPrimaryTerm)
&& Objects.equals(this.size, other.size)
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/explain/Explanation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/explain/Explanation.java
index cf72619490..a9935e3be0 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/explain/Explanation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/explain/Explanation.java
@@ -67,8 +67,7 @@ public class Explanation implements PlainJsonSerializable, ToCopyableBuilder details;
- @Nonnull
- private final Number value;
+ private final float value;
// ---------------------------------------------------------------------------------------------
@@ -101,8 +100,7 @@ public final List details() {
/**
* Required - API name: {@code value}
*/
- @Nonnull
- public final Number value() {
+ public final float value() {
return this.value;
}
@@ -130,7 +128,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
generator.writeKey("value");
- generator.write(this.value.doubleValue());
+ generator.write(this.value);
}
// ---------------------------------------------------------------------------------------------
@@ -153,7 +151,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
private String description;
@Nullable
private List details;
- private Number value;
+ private Float value;
public Builder() {}
@@ -226,7 +224,7 @@ public final Builder details(Function op) {
op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description");
op.add(Builder::details, JsonpDeserializer.arrayDeserializer(Explanation._DESERIALIZER), "details");
- op.add(Builder::value, JsonpDeserializer.numberDeserializer(), "value");
+ op.add(Builder::value, JsonpDeserializer.floatDeserializer(), "value");
}
@Override
@@ -266,7 +264,7 @@ public int hashCode() {
int result = 17;
result = 31 * result + this.description.hashCode();
result = 31 * result + Objects.hashCode(this.details);
- result = 31 * result + this.value.hashCode();
+ result = 31 * result + Float.hashCode(this.value);
return result;
}
@@ -275,6 +273,6 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Explanation other = (Explanation) o;
- return this.description.equals(other.description) && Objects.equals(this.details, other.details) && this.value.equals(other.value);
+ return this.description.equals(other.description) && Objects.equals(this.details, other.details) && this.value == other.value;
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/Highlight.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/Highlight.java
index fded93dddc..19032c066b 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/Highlight.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/Highlight.java
@@ -37,7 +37,7 @@
package org.opensearch.client.opensearch.core.search;
import jakarta.json.stream.JsonGenerator;
-import java.util.Map;
+import java.util.List;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
@@ -63,7 +63,7 @@ public class Highlight extends HighlightBase implements ToCopyableBuilder fields;
+ private final List fields;
// ---------------------------------------------------------------------------------------------
@@ -89,7 +89,7 @@ public final HighlighterEncoder encoder() {
* Required - API name: {@code fields}
*/
@Nonnull
- public final Map fields() {
+ public final List fields() {
return this.fields;
}
@@ -101,10 +101,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
generator.writeKey("fields");
- generator.writeStartObject();
- for (Map.Entry item0 : this.fields.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
+ generator.writeStartArray();
+ for (HighlightField item0 : this.fields) {
+ item0.serialize(generator, mapper);
}
generator.writeEnd();
}
@@ -128,20 +127,20 @@ public static Builder builder() {
public static class Builder extends HighlightBase.AbstractBuilder implements CopyableBuilder {
@Nullable
private HighlighterEncoder encoder;
- private Map fields;
+ private List fields;
public Builder() {}
private Builder(Highlight o) {
super(o);
this.encoder = o.encoder;
- this.fields = _mapCopy(o.fields);
+ this.fields = _listCopy(o.fields);
}
private Builder(Builder o) {
super(o);
this.encoder = o.encoder;
- this.fields = _mapCopy(o.fields);
+ this.fields = _listCopy(o.fields);
}
@Override
@@ -169,12 +168,12 @@ public final Builder encoder(@Nullable HighlighterEncoder value) {
* Required - API name: {@code fields}
*
*
- * Adds all elements of map to fields.
+ * Adds all elements of list to fields.
*
*/
@Nonnull
- public final Builder fields(Map map) {
- this.fields = _mapPutAll(this.fields, map);
+ public final Builder fields(List list) {
+ this.fields = _listAddAll(this.fields, list);
return this;
}
@@ -182,12 +181,12 @@ public final Builder fields(Map map) {
* Required - API name: {@code fields}
*
*
- * Adds an entry to fields.
+ * Adds one or more values to fields.
*
*/
@Nonnull
- public final Builder fields(String key, HighlightField value) {
- this.fields = _mapPut(this.fields, key, value);
+ public final Builder fields(HighlightField value, HighlightField... values) {
+ this.fields = _listAdd(this.fields, value, values);
return this;
}
@@ -199,8 +198,8 @@ public final Builder fields(String key, HighlightField value) {
*
*/
@Nonnull
- public final Builder fields(String key, Function> fn) {
- return fields(key, fn.apply(new HighlightField.Builder()).build());
+ public final Builder fields(Function> fn) {
+ return fields(fn.apply(new HighlightField.Builder()).build());
}
/**
@@ -230,7 +229,7 @@ public Highlight build() {
protected static void setupHighlightDeserializer(ObjectDeserializer op) {
setupHighlightBaseDeserializer(op);
op.add(Builder::encoder, HighlighterEncoder._DESERIALIZER, "encoder");
- op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(HighlightField._DESERIALIZER), "fields");
+ op.add(Builder::fields, JsonpDeserializer.arrayDeserializer(HighlightField._DESERIALIZER), "fields");
}
@Override
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HighlightField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HighlightField.java
index 56c1febfa1..4bbbbca049 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HighlightField.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HighlightField.java
@@ -48,7 +48,6 @@
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
-import org.opensearch.client.opensearch._types.analysis.Analyzer;
import org.opensearch.client.util.ApiTypeHelper;
import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
@@ -60,8 +59,8 @@
@Generated("org.opensearch.client.codegen.CodeGenerator")
public class HighlightField extends HighlightBase implements ToCopyableBuilder {
- @Nullable
- private final Analyzer analyzer;
+ @Nonnull
+ private final String key;
@Nonnull
private final List matchedFields;
@@ -70,7 +69,7 @@ public class HighlightField extends HighlightBase implements ToCopyableBuilder matchedFields() {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeStartObject(this.key);
super.serializeInternal(generator, mapper);
- if (this.analyzer != null) {
- generator.writeKey("analyzer");
- this.analyzer.serialize(generator, mapper);
- }
-
if (ApiTypeHelper.isDefined(this.matchedFields)) {
generator.writeKey("matched_fields");
generator.writeStartArray();
@@ -109,6 +104,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
generator.writeEnd();
}
+ generator.writeEnd();
}
// ---------------------------------------------------------------------------------------------
@@ -128,8 +124,7 @@ public static Builder builder() {
* Builder for {@link HighlightField}.
*/
public static class Builder extends HighlightBase.AbstractBuilder implements CopyableBuilder {
- @Nullable
- private Analyzer analyzer;
+ private String key;
@Nullable
private List matchedFields;
@@ -137,13 +132,13 @@ public Builder() {}
private Builder(HighlightField o) {
super(o);
- this.analyzer = o.analyzer;
+ this.key = o.key;
this.matchedFields = _listCopy(o.matchedFields);
}
private Builder(Builder o) {
super(o);
- this.analyzer = o.analyzer;
+ this.key = o.key;
this.matchedFields = _listCopy(o.matchedFields);
}
@@ -160,22 +155,14 @@ protected Builder self() {
}
/**
- * API name: {@code analyzer}
+ * Required - The target key
*/
@Nonnull
- public final Builder analyzer(@Nullable Analyzer value) {
- this.analyzer = value;
+ public final Builder key(String value) {
+ this.key = value;
return this;
}
- /**
- * API name: {@code analyzer}
- */
- @Nonnull
- public final Builder analyzer(Function> fn) {
- return analyzer(fn.apply(new Analyzer.Builder()).build());
- }
-
/**
* API name: {@code matched_fields}
*
@@ -228,14 +215,14 @@ public HighlightField build() {
protected static void setupHighlightFieldDeserializer(ObjectDeserializer op) {
setupHighlightBaseDeserializer(op);
- op.add(Builder::analyzer, Analyzer._DESERIALIZER, "analyzer");
op.add(Builder::matchedFields, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "matched_fields");
+ op.setKey(Builder::key, JsonpDeserializer.stringDeserializer());
}
@Override
public int hashCode() {
int result = super.hashCode();
- result = 31 * result + Objects.hashCode(this.analyzer);
+ result = 31 * result + this.key.hashCode();
result = 31 * result + Objects.hashCode(this.matchedFields);
return result;
}
@@ -248,6 +235,6 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
HighlightField other = (HighlightField) o;
- return Objects.equals(this.analyzer, other.analyzer) && Objects.equals(this.matchedFields, other.matchedFields);
+ return this.key.equals(other.key) && Objects.equals(this.matchedFields, other.matchedFields);
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HighlighterTagsSchema.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HighlighterTagsSchema.java
index 0fd86d10db..8c4e48166e 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HighlighterTagsSchema.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HighlighterTagsSchema.java
@@ -45,6 +45,8 @@
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum HighlighterTagsSchema implements JsonEnum {
+ Default("default"),
+
Styled("styled");
private final String jsonValue;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/Hit.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/Hit.java
index 91cc460f3f..eb96d6b596 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/Hit.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/Hit.java
@@ -37,6 +37,7 @@
package org.opensearch.client.opensearch.core.search;
import jakarta.json.stream.JsonGenerator;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -92,6 +93,9 @@ public class Hit implements PlainJsonSerializable, ToCopyableBuilder<
@Nonnull
private final List matchedQueries;
+ @Nonnull
+ private final Map metaFields;
+
@Nullable
private final NestedIdentity nested;
@@ -137,6 +141,7 @@ private Hit(Builder builder) {
this.index = builder.index;
this.innerHits = ApiTypeHelper.unmodifiable(builder.innerHits);
this.matchedQueries = ApiTypeHelper.unmodifiable(builder.matchedQueries);
+ this.metaFields = ApiTypeHelper.unmodifiable(builder.metaFields);
this.nested = builder.nested;
this.node = builder.node;
this.primaryTerm = builder.primaryTerm;
@@ -226,6 +231,14 @@ public final List matchedQueries() {
return this.matchedQueries;
}
+ /**
+ * Contains metadata values for the documents.
+ */
+ @Nonnull
+ public final Map metaFields() {
+ return this.metaFields;
+ }
+
/**
* API name: {@code _nested}
*/
@@ -325,6 +338,10 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ for (Map.Entry item0 : this.metaFields.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
if (this.explanation != null) {
generator.writeKey("_explanation");
this.explanation.serialize(generator, mapper);
@@ -501,6 +518,8 @@ public static class Builder extends ObjectBuilderBase implements Copy
@Nullable
private List matchedQueries;
@Nullable
+ private Map metaFields;
+ @Nullable
private NestedIdentity nested;
@Nullable
private String node;
@@ -535,6 +554,7 @@ private Builder(Hit o) {
this.index = o.index;
this.innerHits = _mapCopy(o.innerHits);
this.matchedQueries = _listCopy(o.matchedQueries);
+ this.metaFields = _mapCopy(o.metaFields);
this.nested = o.nested;
this.node = o.node;
this.primaryTerm = o.primaryTerm;
@@ -558,6 +578,7 @@ private Builder(Builder o) {
this.index = o.index;
this.innerHits = _mapCopy(o.innerHits);
this.matchedQueries = _listCopy(o.matchedQueries);
+ this.metaFields = _mapCopy(o.metaFields);
this.nested = o.nested;
this.node = o.node;
this.primaryTerm = o.primaryTerm;
@@ -780,6 +801,32 @@ public final Builder matchedQueries(String value, String... values) {
return this;
}
+ /**
+ * Contains metadata values for the documents.
+ *
+ *
+ * Adds all elements of map to metaFields.
+ *
+ */
+ @Nonnull
+ public final Builder metaFields(Map map) {
+ this.metaFields = _mapPutAll(this.metaFields, map);
+ return this;
+ }
+
+ /**
+ * Contains metadata values for the documents.
+ *
+ *
+ * Adds an entry to metaFields.
+ *
+ */
+ @Nonnull
+ public final Builder metaFields(String key, JsonData value) {
+ this.metaFields = _mapPut(this.metaFields, key, value);
+ return this;
+ }
+
/**
* API name: {@code _nested}
*/
@@ -973,6 +1020,12 @@ protected static void setupHitDeserializer(
op.add(Builder::sort, JsonpDeserializer.arrayDeserializer(FieldValue._DESERIALIZER), "sort");
op.add(Builder::source, tDocumentDeserializer, "_source");
op.add(Builder::version, JsonpDeserializer.longDeserializer(), "_version");
+ op.setUnknownFieldHandler((builder, name, parser, mapper) -> {
+ if (builder.metaFields == null) {
+ builder.metaFields = new HashMap<>();
+ }
+ builder.metaFields.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper));
+ });
}
@Override
@@ -987,6 +1040,7 @@ public int hashCode() {
result = 31 * result + Objects.hashCode(this.index);
result = 31 * result + Objects.hashCode(this.innerHits);
result = 31 * result + Objects.hashCode(this.matchedQueries);
+ result = 31 * result + Objects.hashCode(this.metaFields);
result = 31 * result + Objects.hashCode(this.nested);
result = 31 * result + Objects.hashCode(this.node);
result = 31 * result + Objects.hashCode(this.primaryTerm);
@@ -1014,6 +1068,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.index, other.index)
&& Objects.equals(this.innerHits, other.innerHits)
&& Objects.equals(this.matchedQueries, other.matchedQueries)
+ && Objects.equals(this.metaFields, other.metaFields)
&& Objects.equals(this.nested, other.nested)
&& Objects.equals(this.node, other.node)
&& Objects.equals(this.primaryTerm, other.primaryTerm)
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HitsMetadata.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HitsMetadata.java
index b87fc64e86..906e302df3 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HitsMetadata.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/HitsMetadata.java
@@ -57,10 +57,13 @@
// typedef: core.search.HitsMetadata
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class HitsMetadata implements PlainJsonSerializable, ToCopyableBuilder, HitsMetadata> {
+public class HitsMetadata
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder, HitsMetadata> {
@Nonnull
- private final List> hits;
+ private final List> hits;
@Nullable
private final Float maxScore;
@@ -70,13 +73,15 @@ public class HitsMetadata implements PlainJsonSerializable, ToCopyableBuilder
// ---------------------------------------------------------------------------------------------
- private HitsMetadata(Builder builder) {
+ private HitsMetadata(Builder builder) {
this.hits = ApiTypeHelper.unmodifiableRequired(builder.hits, this, "hits");
this.maxScore = builder.maxScore;
this.total = builder.total;
}
- public static HitsMetadata of(Function, ObjectBuilder>> fn) {
+ public static HitsMetadata of(
+ Function, ObjectBuilder>> fn
+ ) {
return fn.apply(new Builder<>()).build();
}
@@ -84,7 +89,7 @@ public static HitsMetadata of(Function, ObjectBui
* Required - API name: {@code hits}
*/
@Nonnull
- public final List> hits() {
+ public final List> hits() {
return this.hits;
}
@@ -120,7 +125,7 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("hits");
generator.writeStartArray();
- for (Hit item0 : this.hits) {
+ for (Hit item0 : this.hits) {
item0.serialize(generator, mapper);
}
generator.writeEnd();
@@ -140,20 +145,22 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
@Override
@Nonnull
- public Builder toBuilder() {
+ public Builder toBuilder() {
return new Builder<>(this);
}
@Nonnull
- public static Builder builder() {
+ public static Builder builder() {
return new Builder<>();
}
/**
* Builder for {@link HitsMetadata}.
*/
- public static class Builder extends ObjectBuilderBase implements CopyableBuilder, HitsMetadata> {
- private List> hits;
+ public static class Builder extends ObjectBuilderBase
+ implements
+ CopyableBuilder, HitsMetadata> {
+ private List> hits;
@Nullable
private Float maxScore;
@Nullable
@@ -161,13 +168,13 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuil
public Builder() {}
- private Builder(HitsMetadata o) {
+ private Builder(HitsMetadata o) {
this.hits = _listCopy(o.hits);
this.maxScore = o.maxScore;
this.total = o.total;
}
- private Builder(Builder o) {
+ private Builder(Builder o) {
this.hits = _listCopy(o.hits);
this.maxScore = o.maxScore;
this.total = o.total;
@@ -175,7 +182,7 @@ private Builder(Builder o) {
@Override
@Nonnull
- public Builder copy() {
+ public Builder copy() {
return new Builder<>(this);
}
@@ -187,7 +194,7 @@ public Builder copy() {
*
*/
@Nonnull
- public final Builder hits(List> list) {
+ public final Builder hits(List> list) {
this.hits = _listAddAll(this.hits, list);
return this;
}
@@ -200,7 +207,7 @@ public final Builder hits(List> list) {
*
*/
@Nonnull
- public final Builder hits(Hit value, Hit... values) {
+ public final Builder hits(Hit value, Hit... values) {
this.hits = _listAdd(this.hits, value, values);
return this;
}
@@ -213,15 +220,15 @@ public final Builder hits(Hit value, Hit... values) {
*
*/
@Nonnull
- public final Builder hits(Function, ObjectBuilder>> fn) {
- return hits(fn.apply(new Hit.Builder()).build());
+ public final Builder hits(Function, ObjectBuilder>> fn) {
+ return hits(fn.apply(new Hit.Builder()).build());
}
/**
* API name: {@code max_score}
*/
@Nonnull
- public final Builder maxScore(@Nullable Float value) {
+ public final Builder maxScore(@Nullable Float value) {
this.maxScore = value;
return this;
}
@@ -233,7 +240,7 @@ public final Builder maxScore(@Nullable Float value) {
*
*/
@Nonnull
- public final Builder total(@Nullable TotalHits value) {
+ public final Builder total(@Nullable TotalHits value) {
this.total = value;
return this;
}
@@ -245,7 +252,7 @@ public final Builder total(@Nullable TotalHits value) {
*
*/
@Nonnull
- public final Builder total(Function> fn) {
+ public final Builder