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 @@ -71,6 +71,8 @@
import co.elastic.clients.elasticsearch.core.IndexResponse;
import co.elastic.clients.elasticsearch.core.InfoRequest;
import co.elastic.clients.elasticsearch.core.InfoResponse;
import co.elastic.clients.elasticsearch.core.KnnEvalRequest;
import co.elastic.clients.elasticsearch.core.KnnEvalResponse;
import co.elastic.clients.elasticsearch.core.ListReindexRequest;
import co.elastic.clients.elasticsearch.core.ListReindexResponse;
import co.elastic.clients.elasticsearch.core.MgetRequest;
Expand Down Expand Up @@ -3556,6 +3558,83 @@ public CompletableFuture<InfoResponse> info() {
return this.transport.performRequestAsync(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions);
}

// ----- Endpoint: knn_eval

/**
* Evaluate kNN search settings.
* <p>
* Estimate the recall and cost of approximate kNN search configurations on a
* <code>dense_vector</code> field against a more thorough baseline. The field
* must use the <code>bbq_disk</code> index type, and must not be inside a
* nested object.
* <p>
* Each <code>knn_settings</code> entry reports the mean recall of the
* baseline's top <code>k</code>, not of relevance judgments, plus included and
* excluded query counts and cost totals. A query is excluded from the mean
* recall when the candidate finds a document scoring above the baseline's
* lowest top <code>k</code> score. A baseline returning fewer than
* <code>k</code> hits fails that query, because recall at <code>k</code> is
* undefined. All configurations run against one point in time.
* <p>
* The default baseline uses a <code>visit_percentage</code> of 20 and a
* <code>rescore_vector.oversample</code> of 100. An exact full-precision
* baseline must be requested explicitly with <code>allow_exact_baseline</code>,
* and is limited to 100 million vector-by-query comparisons.
* <p>
* The request is refused when the <code>search.knn_eval.enabled</code> cluster
* setting or the <code>index.knn_eval.enabled</code> index setting is
* <code>false</code>.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-knn-eval">Documentation
* on elastic.co</a>
*/

public CompletableFuture<KnnEvalResponse> knnEval(KnnEvalRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<KnnEvalRequest, KnnEvalResponse, ErrorResponse> endpoint = (JsonEndpoint<KnnEvalRequest, KnnEvalResponse, ErrorResponse>) KnnEvalRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}

/**
* Evaluate kNN search settings.
* <p>
* Estimate the recall and cost of approximate kNN search configurations on a
* <code>dense_vector</code> field against a more thorough baseline. The field
* must use the <code>bbq_disk</code> index type, and must not be inside a
* nested object.
* <p>
* Each <code>knn_settings</code> entry reports the mean recall of the
* baseline's top <code>k</code>, not of relevance judgments, plus included and
* excluded query counts and cost totals. A query is excluded from the mean
* recall when the candidate finds a document scoring above the baseline's
* lowest top <code>k</code> score. A baseline returning fewer than
* <code>k</code> hits fails that query, because recall at <code>k</code> is
* undefined. All configurations run against one point in time.
* <p>
* The default baseline uses a <code>visit_percentage</code> of 20 and a
* <code>rescore_vector.oversample</code> of 100. An exact full-precision
* baseline must be requested explicitly with <code>allow_exact_baseline</code>,
* and is limited to 100 million vector-by-query comparisons.
* <p>
* The request is refused when the <code>search.knn_eval.enabled</code> cluster
* setting or the <code>index.knn_eval.enabled</code> index setting is
* <code>false</code>.
*
* @param fn
* a function that initializes a builder to create the
* {@link KnnEvalRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-knn-eval">Documentation
* on elastic.co</a>
*/

public final CompletableFuture<KnnEvalResponse> knnEval(
Function<KnnEvalRequest.Builder, ObjectBuilder<KnnEvalRequest>> fn) {
return knnEval(fn.apply(new KnnEvalRequest.Builder()).build());
}

// ----- Endpoint: list_reindex

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
import co.elastic.clients.elasticsearch.core.IndexResponse;
import co.elastic.clients.elasticsearch.core.InfoRequest;
import co.elastic.clients.elasticsearch.core.InfoResponse;
import co.elastic.clients.elasticsearch.core.KnnEvalRequest;
import co.elastic.clients.elasticsearch.core.KnnEvalResponse;
import co.elastic.clients.elasticsearch.core.ListReindexRequest;
import co.elastic.clients.elasticsearch.core.ListReindexResponse;
import co.elastic.clients.elasticsearch.core.MgetRequest;
Expand Down Expand Up @@ -3578,6 +3580,83 @@ public InfoResponse info() throws IOException, ElasticsearchException {
return this.transport.performRequest(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions);
}

// ----- Endpoint: knn_eval

/**
* Evaluate kNN search settings.
* <p>
* Estimate the recall and cost of approximate kNN search configurations on a
* <code>dense_vector</code> field against a more thorough baseline. The field
* must use the <code>bbq_disk</code> index type, and must not be inside a
* nested object.
* <p>
* Each <code>knn_settings</code> entry reports the mean recall of the
* baseline's top <code>k</code>, not of relevance judgments, plus included and
* excluded query counts and cost totals. A query is excluded from the mean
* recall when the candidate finds a document scoring above the baseline's
* lowest top <code>k</code> score. A baseline returning fewer than
* <code>k</code> hits fails that query, because recall at <code>k</code> is
* undefined. All configurations run against one point in time.
* <p>
* The default baseline uses a <code>visit_percentage</code> of 20 and a
* <code>rescore_vector.oversample</code> of 100. An exact full-precision
* baseline must be requested explicitly with <code>allow_exact_baseline</code>,
* and is limited to 100 million vector-by-query comparisons.
* <p>
* The request is refused when the <code>search.knn_eval.enabled</code> cluster
* setting or the <code>index.knn_eval.enabled</code> index setting is
* <code>false</code>.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-knn-eval">Documentation
* on elastic.co</a>
*/

public KnnEvalResponse knnEval(KnnEvalRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint<KnnEvalRequest, KnnEvalResponse, ErrorResponse> endpoint = (JsonEndpoint<KnnEvalRequest, KnnEvalResponse, ErrorResponse>) KnnEvalRequest._ENDPOINT;

return this.transport.performRequest(request, endpoint, this.transportOptions);
}

/**
* Evaluate kNN search settings.
* <p>
* Estimate the recall and cost of approximate kNN search configurations on a
* <code>dense_vector</code> field against a more thorough baseline. The field
* must use the <code>bbq_disk</code> index type, and must not be inside a
* nested object.
* <p>
* Each <code>knn_settings</code> entry reports the mean recall of the
* baseline's top <code>k</code>, not of relevance judgments, plus included and
* excluded query counts and cost totals. A query is excluded from the mean
* recall when the candidate finds a document scoring above the baseline's
* lowest top <code>k</code> score. A baseline returning fewer than
* <code>k</code> hits fails that query, because recall at <code>k</code> is
* undefined. All configurations run against one point in time.
* <p>
* The default baseline uses a <code>visit_percentage</code> of 20 and a
* <code>rescore_vector.oversample</code> of 100. An exact full-precision
* baseline must be requested explicitly with <code>allow_exact_baseline</code>,
* and is limited to 100 million vector-by-query comparisons.
* <p>
* The request is refused when the <code>search.knn_eval.enabled</code> cluster
* setting or the <code>index.knn_eval.enabled</code> index setting is
* <code>false</code>.
*
* @param fn
* a function that initializes a builder to create the
* {@link KnnEvalRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-knn-eval">Documentation
* on elastic.co</a>
*/

public final KnnEvalResponse knnEval(Function<KnnEvalRequest.Builder, ObjectBuilder<KnnEvalRequest>> fn)
throws IOException, ElasticsearchException {
return knnEval(fn.apply(new KnnEvalRequest.Builder()).build());
}

// ----- Endpoint: list_reindex

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package co.elastic.clients.elasticsearch._types;

import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
import co.elastic.clients.json.JsonpSerializable;
import co.elastic.clients.json.JsonpUtils;
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.json.UnionDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.TaggedUnion;
import co.elastic.clients.util.TaggedUnionUtils;
import jakarta.json.stream.JsonGenerator;
import java.lang.Object;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;

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

// typedef: _types.BulkByPaginatedSearchFailure

/**
*
* @see <a href=
* "../doc-files/api-spec.html#_types.BulkByPaginatedSearchFailure">API
* specification</a>
*/
@JsonpDeserializable
public class BulkByPaginatedSearchFailure
implements
TaggedUnion<BulkByPaginatedSearchFailure.Kind, Object>,
JsonpSerializable {

public enum Kind {
Bulk, Search

}

private final Kind _kind;
private final Object _value;

@Override
public final Kind _kind() {
return _kind;
}

@Override
public final Object _get() {
return _value;
}

private BulkByPaginatedSearchFailure(Kind kind, Object value) {
this._kind = kind;
this._value = value;
}

private BulkByPaginatedSearchFailure(Builder builder) {

this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, "<variant kind>");
this._value = ApiTypeHelper.requireNonNull(builder._value, builder, "<variant value>");

}

public static BulkByPaginatedSearchFailure of(Function<Builder, ObjectBuilder<BulkByPaginatedSearchFailure>> fn) {
return fn.apply(new Builder()).build();
}

/**
* Is this variant instance of kind {@code bulk}?
*/
public boolean isBulk() {
return _kind == Kind.Bulk;
}

/**
* Get the {@code bulk} variant value.
*
* @throws IllegalStateException
* if the current variant is not of the {@code bulk} kind.
*/
public BulkIndexByScrollFailure bulk() {
return TaggedUnionUtils.get(this, Kind.Bulk);
}

/**
* Is this variant instance of kind {@code search}?
*/
public boolean isSearch() {
return _kind == Kind.Search;
}

/**
* Get the {@code search} variant value.
*
* @throws IllegalStateException
* if the current variant is not of the {@code search} kind.
*/
public ShardFailure search() {
return TaggedUnionUtils.get(this, Kind.Search);
}

@Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
if (_value instanceof JsonpSerializable) {
((JsonpSerializable) _value).serialize(generator, mapper);
}

}

@Override
public String toString() {
return JsonpUtils.toString(this);
}

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<BulkByPaginatedSearchFailure> {
private Kind _kind;
private Object _value;

public ObjectBuilder<BulkByPaginatedSearchFailure> bulk(BulkIndexByScrollFailure v) {
this._kind = Kind.Bulk;
this._value = v;
return this;
}

public ObjectBuilder<BulkByPaginatedSearchFailure> bulk(
Function<BulkIndexByScrollFailure.Builder, ObjectBuilder<BulkIndexByScrollFailure>> fn) {
return this.bulk(fn.apply(new BulkIndexByScrollFailure.Builder()).build());
}

public ObjectBuilder<BulkByPaginatedSearchFailure> search(ShardFailure v) {
this._kind = Kind.Search;
this._value = v;
return this;
}

public ObjectBuilder<BulkByPaginatedSearchFailure> search(
Function<ShardFailure.Builder, ObjectBuilder<ShardFailure>> fn) {
return this.search(fn.apply(new ShardFailure.Builder()).build());
}

public BulkByPaginatedSearchFailure build() {
_checkSingleUse();
return new BulkByPaginatedSearchFailure(this);
}

}

private static JsonpDeserializer<BulkByPaginatedSearchFailure> buildBulkByPaginatedSearchFailureDeserializer() {
return new UnionDeserializer.Builder<BulkByPaginatedSearchFailure, Kind, Object>(
BulkByPaginatedSearchFailure::new, false).addMember(Kind.Bulk, BulkIndexByScrollFailure._DESERIALIZER)
.addMember(Kind.Search, ShardFailure._DESERIALIZER).build();
}

public static final JsonpDeserializer<BulkByPaginatedSearchFailure> _DESERIALIZER = JsonpDeserializer
.lazy(BulkByPaginatedSearchFailure::buildBulkByPaginatedSearchFailureDeserializer);
}
Loading
Loading