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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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.
* <p>
* API name: {@code num_candidates}
*/
public final int numCandidates() {
@Nullable
public final Integer numCandidates() {
return this.numCandidates;
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -248,6 +252,7 @@ public static class Builder extends RetrieverBase.AbstractBuilder<Builder> imple

private Integer k;

@Nullable
private Integer numCandidates;

@Nullable
Expand Down Expand Up @@ -351,11 +356,11 @@ public final Builder k(int value) {
}

/**
* Required - Number of nearest neighbor candidates to consider per shard.
* Number of nearest neighbor candidates to consider per shard.
* <p>
* API name: {@code num_candidates}
*/
public final Builder numCandidates(int value) {
public final Builder numCandidates(@Nullable Integer value) {
this.numCandidates = value;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/3c9583e2aba3cf9be15537db19a95b47e37296c3/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/9e6a85519c8ff55a5977e03137a661c07532a232/specification/">Elasticsearch API specification</a>.
</body>
</html>
Loading