Skip to content
Open
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 @@ -4220,9 +4220,10 @@ public final CompletableFuture<RankEvalResponse> rankEval(
* must explicitly allow the remote host using the
* <code>reindex.remote.whitelist</code> node setting on the destination
* cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless
* project, only remote hosts from Elastic Cloud Hosted are allowed. Automatic
* data stream creation requires a matching index template with data stream
* enabled.
* project, only remote hosts from <a href=
* "https://cloud.elastic.co/registration?page=docs&amp;placement=docs-body">Elastic
* Cloud Hosted</a> are allowed. Automatic data stream creation requires a
* matching index template with data stream enabled.
* <p>
* The <code>dest</code> element can be configured like the index API to control
* optimistic concurrency control. Omitting <code>version_type</code> or setting
Expand Down Expand Up @@ -4316,9 +4317,10 @@ public CompletableFuture<ReindexResponse> reindex(ReindexRequest request) {
* must explicitly allow the remote host using the
* <code>reindex.remote.whitelist</code> node setting on the destination
* cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless
* project, only remote hosts from Elastic Cloud Hosted are allowed. Automatic
* data stream creation requires a matching index template with data stream
* enabled.
* project, only remote hosts from <a href=
* "https://cloud.elastic.co/registration?page=docs&amp;placement=docs-body">Elastic
* Cloud Hosted</a> are allowed. Automatic data stream creation requires a
* matching index template with data stream enabled.
* <p>
* The <code>dest</code> element can be configured like the index API to control
* optimistic concurrency control. Omitting <code>version_type</code> or setting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4249,9 +4249,10 @@ public final RankEvalResponse rankEval(Function<RankEvalRequest.Builder, ObjectB
* must explicitly allow the remote host using the
* <code>reindex.remote.whitelist</code> node setting on the destination
* cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless
* project, only remote hosts from Elastic Cloud Hosted are allowed. Automatic
* data stream creation requires a matching index template with data stream
* enabled.
* project, only remote hosts from <a href=
* "https://cloud.elastic.co/registration?page=docs&amp;placement=docs-body">Elastic
* Cloud Hosted</a> are allowed. Automatic data stream creation requires a
* matching index template with data stream enabled.
* <p>
* The <code>dest</code> element can be configured like the index API to control
* optimistic concurrency control. Omitting <code>version_type</code> or setting
Expand Down Expand Up @@ -4345,9 +4346,10 @@ public ReindexResponse reindex(ReindexRequest request) throws IOException, Elast
* must explicitly allow the remote host using the
* <code>reindex.remote.whitelist</code> node setting on the destination
* cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless
* project, only remote hosts from Elastic Cloud Hosted are allowed. Automatic
* data stream creation requires a matching index template with data stream
* enabled.
* project, only remote hosts from <a href=
* "https://cloud.elastic.co/registration?page=docs&amp;placement=docs-body">Elastic
* Cloud Hosted</a> are allowed. Automatic data stream creation requires a
* matching index template with data stream enabled.
* <p>
* The <code>dest</code> element can be configured like the index API to control
* optimistic concurrency control. Omitting <code>version_type</code> or setting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public enum FieldType implements JsonEnum {

SearchAsYouType("search_as_you_type"),

Wildcard("wildcard"),

Date("date"),

DateNanos("date_nanos"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
/*
* 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.query_dsl;

import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
import co.elastic.clients.json.ObjectBuilderDeserializer;
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import jakarta.json.stream.JsonGenerator;
import java.lang.Long;
import java.lang.String;
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.query_dsl.LongNumberRangeQuery

/**
*
* @see <a href=
* "../../doc-files/api-spec.html#_types.query_dsl.LongNumberRangeQuery">API
* specification</a>
*/
@JsonpDeserializable
public class LongNumberRangeQuery extends RangeQueryBase<Long> implements RangeQueryVariant {
// Single key dictionary
private final String field;

// ---------------------------------------------------------------------------------------------

private LongNumberRangeQuery(Builder builder) {
super(builder);
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");

}

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

/**
* RangeQuery variant kind.
*/
@Override
public RangeQuery.Kind _rangeQueryKind() {
return RangeQuery.Kind.LongNumber;
}

/**
* Required - the required field
*/
public final String field() {
return this.field;
}

protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject(this.field);

super.serializeInternal(generator, mapper);

generator.writeEnd();

}

// ---------------------------------------------------------------------------------------------

/**
* Builder for {@link LongNumberRangeQuery}.
*/

public static class Builder extends RangeQueryBase.AbstractBuilder<Long, Builder>
implements
ObjectBuilder<LongNumberRangeQuery> {
private String field;

/**
* Required - the required field
*/
public final Builder field(String value) {
this.field = value;
return this;
}

public Builder() {
}
private Builder(LongNumberRangeQuery instance) {

}
@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link LongNumberRangeQuery}.
*
* @throws NullPointerException
* if some of the required fields are null.
*/
public LongNumberRangeQuery build() {
_checkSingleUse();
super.tSerializer(null);

return new LongNumberRangeQuery(this);
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
* Json deserializer for {@link LongNumberRangeQuery}
*/
public static final JsonpDeserializer<LongNumberRangeQuery> _DESERIALIZER = ObjectBuilderDeserializer
.lazy(Builder::new, LongNumberRangeQuery::setupLongNumberRangeQueryDeserializer);

protected static void setupLongNumberRangeQueryDeserializer(ObjectDeserializer<LongNumberRangeQuery.Builder> op) {
RangeQueryBase.setupRangeQueryBaseDeserializer(op, JsonpDeserializer.longDeserializer());

op.setKey(Builder::field, JsonpDeserializer.stringDeserializer());

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public class RangeQuery
public enum Kind implements JsonEnum {
Date("date"),

LongNumber("long_number"),

Number("number"),

Term("term"),
Expand Down Expand Up @@ -190,6 +192,23 @@ public DateRangeQuery date() {
return TaggedUnionUtils.get(this, Kind.Date);
}

/**
* Is this variant instance of kind {@code long_number}?
*/
public boolean isLongNumber() {
return _kind == Kind.LongNumber;
}

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

/**
* Is this variant instance of kind {@code number}?
*/
Expand Down Expand Up @@ -267,6 +286,17 @@ public ObjectBuilder<RangeQuery> date(Function<DateRangeQuery.Builder, ObjectBui
return this.date(fn.apply(new DateRangeQuery.Builder()).build());
}

public ObjectBuilder<RangeQuery> longNumber(LongNumberRangeQuery v) {
this._kind = Kind.LongNumber;
this._value = v;
return this;
}

public ObjectBuilder<RangeQuery> longNumber(
Function<LongNumberRangeQuery.Builder, ObjectBuilder<LongNumberRangeQuery>> fn) {
return this.longNumber(fn.apply(new LongNumberRangeQuery.Builder()).build());
}

public ObjectBuilder<RangeQuery> number(NumberRangeQuery v) {
this._kind = Kind.Number;
this._value = v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ public static RangeQuery date(Function<DateRangeQuery.Builder, ObjectBuilder<Dat
return builder.build();
}

/**
* Creates a builder for the {@link LongNumberRangeQuery long_number}
* {@code RangeQuery} variant.
*/
public static LongNumberRangeQuery.Builder longNumber() {
return new LongNumberRangeQuery.Builder();
}

/**
* Creates a RangeQuery of the {@link LongNumberRangeQuery long_number}
* {@code RangeQuery} variant.
*/
public static RangeQuery longNumber(
Function<LongNumberRangeQuery.Builder, ObjectBuilder<LongNumberRangeQuery>> fn) {
RangeQuery.Builder builder = new RangeQuery.Builder();
builder.longNumber(fn.apply(new LongNumberRangeQuery.Builder()).build());
return builder.build();
}

/**
* Creates a builder for the {@link NumberRangeQuery number} {@code RangeQuery}
* variant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@
* must explicitly allow the remote host using the
* <code>reindex.remote.whitelist</code> node setting on the destination
* cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless
* project, only remote hosts from Elastic Cloud Hosted are allowed. Automatic
* data stream creation requires a matching index template with data stream
* enabled.
* project, only remote hosts from <a href=
* "https://cloud.elastic.co/registration?page=docs&amp;placement=docs-body">Elastic
* Cloud Hosted</a> are allowed. Automatic data stream creation requires a
* matching index template with data stream enabled.
* <p>
* The <code>dest</code> element can be configured like the index API to control
* optimistic concurrency control. Omitting <code>version_type</code> or setting
Expand Down
Loading
Loading