diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java index 5dfb7d454..23efbc0e6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java @@ -68,7 +68,8 @@ public class KnnRetriever extends RetrieverBase implements RetrieverVariant { private final int k; - private final int numCandidates; + @Nullable + private final Integer numCandidates; @Nullable private final Float visitPercentage; @@ -88,7 +89,7 @@ private KnnRetriever(Builder builder) { this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); this.queryVectorBuilder = builder.queryVectorBuilder; this.k = ApiTypeHelper.requireNonNull(builder.k, this, "k", 0); - this.numCandidates = ApiTypeHelper.requireNonNull(builder.numCandidates, this, "numCandidates", 0); + this.numCandidates = builder.numCandidates; this.visitPercentage = builder.visitPercentage; this.similarity = builder.similarity; this.rescoreVector = builder.rescoreVector; @@ -147,11 +148,12 @@ public final int k() { } /** - * Required - Number of nearest neighbor candidates to consider per shard. + * Number of nearest neighbor candidates to consider per shard. *
* API name: {@code num_candidates}
*/
- public final int numCandidates() {
+ @Nullable
+ public final Integer numCandidates() {
return this.numCandidates;
}
@@ -210,9 +212,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("k");
generator.write(this.k);
- generator.writeKey("num_candidates");
- generator.write(this.numCandidates);
+ if (this.numCandidates != null) {
+ generator.writeKey("num_candidates");
+ generator.write(this.numCandidates);
+ }
if (this.visitPercentage != null) {
generator.writeKey("visit_percentage");
generator.write(this.visitPercentage);
@@ -248,6 +252,7 @@ public static class Builder extends RetrieverBase.AbstractBuilder
* API name: {@code num_candidates}
*/
- public final Builder numCandidates(int value) {
+ public final Builder numCandidates(@Nullable Integer value) {
this.numCandidates = value;
return this;
}
diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html
index 58cd654f1..f7d5a40b0 100644
--- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html
@@ -1537,7 +1537,7 @@
'esql.put_dataset.Response': 'esql/put_dataset/PutDatasetResponse.ts#L22-L25',
'esql.put_view.Request': 'esql/put_view/PutViewRequest.ts#L23-L49',
'esql.put_view.Response': 'esql/put_view/PutViewResponse.ts#L22-L25',
-'esql.query.Request': 'esql/query/QueryRequest.ts#L28-L154',
+'esql.query.Request': 'esql/query/QueryRequest.ts#L28-L155',
'esql.query.Response': 'esql/query/QueryResponse.ts#L22-L25',
'features._types.Feature': 'features/_types/Feature.ts#L20-L23',
'features.get_features.Request': 'features/get_features/GetFeaturesRequest.ts#L24-L56',
@@ -3641,10 +3641,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
- window.location = "https://github.com/elastic/elasticsearch-specification/tree/3c9583e2aba3cf9be15537db19a95b47e37296c3/specification/" + (paths[hash] || "");
+ window.location = "https://github.com/elastic/elasticsearch-specification/tree/9e6a85519c8ff55a5977e03137a661c07532a232/specification/" + (paths[hash] || "");