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 @@ -32,7 +32,7 @@
import co.elastic.clients.util.TaggedUnion;
import co.elastic.clients.util.TaggedUnionUtils;
import jakarta.json.stream.JsonGenerator;
import java.lang.Double;
import java.lang.Long;
import java.lang.Object;
import java.lang.String;
import java.util.Objects;
Expand Down Expand Up @@ -143,7 +143,7 @@ public boolean isValue() {
* @throws IllegalStateException
* if the current variant is not of the {@code value} kind.
*/
public Double value() {
public Long value() {
return TaggedUnionUtils.get(this, Kind.Value);
}

Expand All @@ -158,7 +158,7 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {

break;
case Value :
generator.write(((Double) this._value));
generator.write(((Long) this._value));

break;
}
Expand All @@ -181,7 +181,7 @@ public ObjectBuilder<FieldDateMath> expr(String v) {
return this;
}

public ObjectBuilder<FieldDateMath> value(Double v) {
public ObjectBuilder<FieldDateMath> value(Long v) {
this._kind = Kind.Value;
this._value = v;
return this;
Expand All @@ -197,7 +197,7 @@ public FieldDateMath build() {
private static JsonpDeserializer<FieldDateMath> buildFieldDateMathDeserializer() {
return new UnionDeserializer.Builder<FieldDateMath, Kind, Object>(FieldDateMath::new, false)
.addMember(Kind.Expr, JsonpDeserializer.stringDeserializer())
.addMember(Kind.Value, JsonpDeserializer.doubleDeserializer()).build();
.addMember(Kind.Value, JsonpDeserializer.longDeserializer()).build();
}

public static final JsonpDeserializer<FieldDateMath> _DESERIALIZER = JsonpDeserializer
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 @@ -39,6 +39,7 @@
import java.lang.Long;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@
'_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L64-L67',
'_types.mapping.FieldMapping': '_types/mapping/meta-fields.ts#L24-L27',
'_types.mapping.FieldNamesField': '_types/mapping/meta-fields.ts#L42-L44',
'_types.mapping.FieldType': '_types/mapping/Property.ts#L193-L242',
'_types.mapping.FieldType': '_types/mapping/Property.ts#L193-L243',
'_types.mapping.FlattenedProperty': '_types/mapping/complex.ts#L26-L38',
'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L158-L161',
'_types.mapping.FloatRangeProperty': '_types/mapping/range.ts#L38-L40',
Expand Down Expand Up @@ -989,6 +989,7 @@
'_types.query_dsl.IntervalsWildcard': '_types/query_dsl/fulltext.ts#L319-L334',
'_types.query_dsl.Like': '_types/query_dsl/specialized.ts#L198-L203',
'_types.query_dsl.LikeDocument': '_types/query_dsl/specialized.ts#L174-L196',
'_types.query_dsl.LongNumberRangeQuery': '_types/query_dsl/term.ts#L174-L174',
'_types.query_dsl.MatchAllQuery': '_types/query_dsl/MatchAllQuery.ts#L22-L25',
'_types.query_dsl.MatchBoolPrefixQuery': '_types/query_dsl/fulltext.ts#L406-L463',
'_types.query_dsl.MatchNoneQuery': '_types/query_dsl/MatchNoneQuery.ts#L22-L25',
Expand All @@ -1011,16 +1012,16 @@
'_types.query_dsl.QueryContainer': '_types/query_dsl/abstractions.ts#L103-L434',
'_types.query_dsl.QueryStringQuery': '_types/query_dsl/fulltext.ts#L649-L772',
'_types.query_dsl.RandomScoreFunction': '_types/query_dsl/compound.ts#L144-L147',
'_types.query_dsl.RangeQuery': '_types/query_dsl/term.ts#L176-L186',
'_types.query_dsl.RangeQuery': '_types/query_dsl/term.ts#L178-L189',
'_types.query_dsl.RangeQueryBase': '_types/query_dsl/term.ts#L122-L148',
'_types.query_dsl.RangeRelation': '_types/query_dsl/term.ts#L188-L201',
'_types.query_dsl.RangeRelation': '_types/query_dsl/term.ts#L191-L204',
'_types.query_dsl.RankFeatureFunction': '_types/query_dsl/specialized.ts#L280-L280',
'_types.query_dsl.RankFeatureFunctionLinear': '_types/query_dsl/specialized.ts#L282-L282',
'_types.query_dsl.RankFeatureFunctionLogarithm': '_types/query_dsl/specialized.ts#L284-L289',
'_types.query_dsl.RankFeatureFunctionSaturation': '_types/query_dsl/specialized.ts#L291-L296',
'_types.query_dsl.RankFeatureFunctionSigmoid': '_types/query_dsl/specialized.ts#L298-L307',
'_types.query_dsl.RankFeatureQuery': '_types/query_dsl/specialized.ts#L309-L335',
'_types.query_dsl.RegexpQuery': '_types/query_dsl/term.ts#L203-L236',
'_types.query_dsl.RegexpQuery': '_types/query_dsl/term.ts#L206-L239',
'_types.query_dsl.RuleQuery': '_types/query_dsl/specialized.ts#L398-L406',
'_types.query_dsl.ScriptQuery': '_types/query_dsl/specialized.ts#L337-L346',
'_types.query_dsl.ScriptScoreFunction': '_types/query_dsl/compound.ts#L137-L142',
Expand All @@ -1041,20 +1042,20 @@
'_types.query_dsl.SpanTermQuery': '_types/query_dsl/span.ts#L134-L140',
'_types.query_dsl.SpanWithinQuery': '_types/query_dsl/span.ts#L142-L156',
'_types.query_dsl.SparseVectorQuery': '_types/query_dsl/SparseVectorQuery.ts#L26-L80',
'_types.query_dsl.TermQuery': '_types/query_dsl/term.ts#L238-L255',
'_types.query_dsl.TermRangeQuery': '_types/query_dsl/term.ts#L174-L174',
'_types.query_dsl.TermsLookup': '_types/query_dsl/term.ts#L270-L275',
'_types.query_dsl.TermsQuery': '_types/query_dsl/term.ts#L257-L263',
'_types.query_dsl.TermsQueryField': '_types/query_dsl/term.ts#L265-L268',
'_types.query_dsl.TermsSetQuery': '_types/query_dsl/term.ts#L277-L299',
'_types.query_dsl.TermQuery': '_types/query_dsl/term.ts#L241-L258',
'_types.query_dsl.TermRangeQuery': '_types/query_dsl/term.ts#L176-L176',
'_types.query_dsl.TermsLookup': '_types/query_dsl/term.ts#L273-L278',
'_types.query_dsl.TermsQuery': '_types/query_dsl/term.ts#L260-L266',
'_types.query_dsl.TermsQueryField': '_types/query_dsl/term.ts#L268-L271',
'_types.query_dsl.TermsSetQuery': '_types/query_dsl/term.ts#L280-L302',
'_types.query_dsl.TextExpansionQuery': '_types/query_dsl/TextExpansionQuery.ts#L23-L36',
'_types.query_dsl.TextQueryType': '_types/query_dsl/fulltext.ts#L610-L636',
'_types.query_dsl.TypeQuery': '_types/query_dsl/term.ts#L301-L303',
'_types.query_dsl.TypeQuery': '_types/query_dsl/term.ts#L304-L306',
'_types.query_dsl.UntypedDecayFunction': '_types/query_dsl/compound.ts#L204-L207',
'_types.query_dsl.UntypedDistanceFeatureQuery': '_types/query_dsl/specialized.ts#L61-L64',
'_types.query_dsl.UntypedRangeQuery': '_types/query_dsl/term.ts#L150-L159',
'_types.query_dsl.WeightedTokensQuery': '_types/query_dsl/WeightedTokensQuery.ts#L25-L33',
'_types.query_dsl.WildcardQuery': '_types/query_dsl/term.ts#L305-L325',
'_types.query_dsl.WildcardQuery': '_types/query_dsl/term.ts#L308-L328',
'_types.query_dsl.WrapperQuery': '_types/query_dsl/abstractions.ts#L508-L517',
'_types.query_dsl.ZeroTermsQuery': '_types/query_dsl/fulltext.ts#L638-L647',
'async_search._types.AsyncSearch': 'async_search/_types/AsyncSearch.ts#L30-L56',
Expand Down Expand Up @@ -3132,10 +3133,10 @@
'transform._types.PivotGroupByContainer': 'transform/_types/Transform.ts#L70-L78',
'transform._types.RetentionPolicy': 'transform/_types/Transform.ts#L88-L96',
'transform._types.RetentionPolicyContainer': 'transform/_types/Transform.ts#L80-L86',
'transform._types.Settings': 'transform/_types/Transform.ts#L98-L166',
'transform._types.Source': 'transform/_types/Transform.ts#L168-L187',
'transform._types.SyncContainer': 'transform/_types/Transform.ts#L191-L197',
'transform._types.TimeSync': 'transform/_types/Transform.ts#L199-L211',
'transform._types.Settings': 'transform/_types/Transform.ts#L98-L165',
'transform._types.Source': 'transform/_types/Transform.ts#L167-L186',
'transform._types.SyncContainer': 'transform/_types/Transform.ts#L190-L196',
'transform._types.TimeSync': 'transform/_types/Transform.ts#L198-L210',
'transform.delete_transform.Request': 'transform/delete_transform/DeleteTransformRequest.ts#L24-L65',
'transform.delete_transform.Response': 'transform/delete_transform/DeleteTransformResponse.ts#L22-L24',
'transform.get_node_stats.Request': 'transform/get_node_stats/GetNodeStatsRequest.ts#L23-L40',
Expand Down Expand Up @@ -3378,10 +3379,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/6ee016a765be615b0205fc209d3d3c515044689d/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/fb6b5c55b2fdb0dd963d8902a0c7c427a2653371/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/6ee016a765be615b0205fc209d3d3c515044689d/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/fb6b5c55b2fdb0dd963d8902a0c7c427a2653371/specification/">Elasticsearch API specification</a>.
</body>
</html>
Loading
Loading