Skip to content

Commit 4961615

Browse files
authored
Partial fixes from spec 2552 (#818)
1 parent c9588aa commit 4961615

File tree

6 files changed

+100
-33
lines changed

6 files changed

+100
-33
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ public String toString() {
15501550
return JsonpUtils.toString(this);
15511551
}
15521552

1553-
public static class Builder extends WithJsonObjectBuilderBase<Builder> {
1553+
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<Aggregation> {
15541554
private Kind _kind;
15551555
private Object _value;
15561556
private String _customKind;
@@ -2374,7 +2374,7 @@ public ContainerBuilder _custom(String name, Object data) {
23742374
return new ContainerBuilder();
23752375
}
23762376

2377-
protected Aggregation build() {
2377+
public Aggregation build() {
23782378
_checkSingleUse();
23792379
return new Aggregation(this);
23802380
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FieldType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public enum FieldType implements JsonEnum {
7373

7474
Object("object"),
7575

76+
Version("version"),
77+
7678
Murmur3("murmur3"),
7779

7880
TokenCount("token_count"),

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/KeywordProperty.java

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package co.elastic.clients.elasticsearch._types.mapping;
2121

22+
import co.elastic.clients.elasticsearch._types.Script;
2223
import co.elastic.clients.json.JsonpDeserializable;
2324
import co.elastic.clients.json.JsonpDeserializer;
2425
import co.elastic.clients.json.JsonpMapper;
@@ -70,6 +71,12 @@ public class KeywordProperty extends DocValuesPropertyBase implements PropertyVa
7071
@Nullable
7172
private final IndexOptions indexOptions;
7273

74+
@Nullable
75+
private final Script script;
76+
77+
@Nullable
78+
private final OnScriptError onScriptError;
79+
7380
@Nullable
7481
private final String normalizer;
7582

@@ -91,6 +98,8 @@ private KeywordProperty(Builder builder) {
9198
this.eagerGlobalOrdinals = builder.eagerGlobalOrdinals;
9299
this.index = builder.index;
93100
this.indexOptions = builder.indexOptions;
101+
this.script = builder.script;
102+
this.onScriptError = builder.onScriptError;
94103
this.normalizer = builder.normalizer;
95104
this.norms = builder.norms;
96105
this.nullValue = builder.nullValue;
@@ -142,6 +151,22 @@ public final IndexOptions indexOptions() {
142151
return this.indexOptions;
143152
}
144153

154+
/**
155+
* API name: {@code script}
156+
*/
157+
@Nullable
158+
public final Script script() {
159+
return this.script;
160+
}
161+
162+
/**
163+
* API name: {@code on_script_error}
164+
*/
165+
@Nullable
166+
public final OnScriptError onScriptError() {
167+
return this.onScriptError;
168+
}
169+
145170
/**
146171
* API name: {@code normalizer}
147172
*/
@@ -197,6 +222,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
197222
generator.writeKey("index_options");
198223
this.indexOptions.serialize(generator, mapper);
199224
}
225+
if (this.script != null) {
226+
generator.writeKey("script");
227+
this.script.serialize(generator, mapper);
228+
229+
}
230+
if (this.onScriptError != null) {
231+
generator.writeKey("on_script_error");
232+
this.onScriptError.serialize(generator, mapper);
233+
}
200234
if (this.normalizer != null) {
201235
generator.writeKey("normalizer");
202236
generator.write(this.normalizer);
@@ -241,6 +275,12 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder<Builde
241275
@Nullable
242276
private IndexOptions indexOptions;
243277

278+
@Nullable
279+
private Script script;
280+
281+
@Nullable
282+
private OnScriptError onScriptError;
283+
244284
@Nullable
245285
private String normalizer;
246286

@@ -285,6 +325,29 @@ public final Builder indexOptions(@Nullable IndexOptions value) {
285325
return this;
286326
}
287327

328+
/**
329+
* API name: {@code script}
330+
*/
331+
public final Builder script(@Nullable Script value) {
332+
this.script = value;
333+
return this;
334+
}
335+
336+
/**
337+
* API name: {@code script}
338+
*/
339+
public final Builder script(Function<Script.Builder, ObjectBuilder<Script>> fn) {
340+
return this.script(fn.apply(new Script.Builder()).build());
341+
}
342+
343+
/**
344+
* API name: {@code on_script_error}
345+
*/
346+
public final Builder onScriptError(@Nullable OnScriptError value) {
347+
this.onScriptError = value;
348+
return this;
349+
}
350+
288351
/**
289352
* API name: {@code normalizer}
290353
*/
@@ -349,6 +412,8 @@ protected static void setupKeywordPropertyDeserializer(ObjectDeserializer<Keywor
349412
op.add(Builder::eagerGlobalOrdinals, JsonpDeserializer.booleanDeserializer(), "eager_global_ordinals");
350413
op.add(Builder::index, JsonpDeserializer.booleanDeserializer(), "index");
351414
op.add(Builder::indexOptions, IndexOptions._DESERIALIZER, "index_options");
415+
op.add(Builder::script, Script._DESERIALIZER, "script");
416+
op.add(Builder::onScriptError, OnScriptError._DESERIALIZER, "on_script_error");
352417
op.add(Builder::normalizer, JsonpDeserializer.stringDeserializer(), "normalizer");
353418
op.add(Builder::norms, JsonpDeserializer.booleanDeserializer(), "norms");
354419
op.add(Builder::nullValue, JsonpDeserializer.stringDeserializer(), "null_value");

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PinnedQuery.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public String toString() {
217217
return JsonpUtils.toString(this);
218218
}
219219

220-
public static class Builder extends QueryBase.AbstractBuilder<Builder> {
220+
public static class Builder extends QueryBase.AbstractBuilder<Builder> implements ObjectBuilder<PinnedQuery> {
221221
private Kind _kind;
222222
private Object _value;
223223

@@ -254,7 +254,7 @@ public ContainerBuilder docs(List<PinnedDoc> v) {
254254
return new ContainerBuilder();
255255
}
256256

257-
protected PinnedQuery build() {
257+
public PinnedQuery build() {
258258
_checkSingleUse();
259259
return new PinnedQuery(this);
260260
}

java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggester.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public String toString() {
288288
return JsonpUtils.toString(this);
289289
}
290290

291-
public static class Builder extends WithJsonObjectBuilderBase<Builder> {
291+
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<FieldSuggester> {
292292
private Kind _kind;
293293
private Object _value;
294294
private String _customKind;
@@ -377,7 +377,7 @@ public ContainerBuilder _custom(String name, Object data) {
377377
return new ContainerBuilder();
378378
}
379379

380-
protected FieldSuggester build() {
380+
public FieldSuggester build() {
381381
_checkSingleUse();
382382
return new FieldSuggester(this);
383383
}

java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@
664664
'_types.mapping.AllField': '_types/mapping/meta-fields.ts#L29-L40',
665665
'_types.mapping.BinaryProperty': '_types/mapping/core.ts#L89-L91',
666666
'_types.mapping.BooleanProperty': '_types/mapping/core.ts#L93-L99',
667-
'_types.mapping.ByteNumberProperty': '_types/mapping/core.ts#L186-L189',
667+
'_types.mapping.ByteNumberProperty': '_types/mapping/core.ts#L188-L191',
668668
'_types.mapping.CompletionProperty': '_types/mapping/specialized.ts#L26-L34',
669669
'_types.mapping.ConstantKeywordProperty': '_types/mapping/specialized.ts#L43-L46',
670670
'_types.mapping.CorePropertyBase': '_types/mapping/core.ts#L52-L56',
@@ -674,67 +674,67 @@
674674
'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorIndexOptions.ts#L22-L26',
675675
'_types.mapping.DenseVectorProperty': '_types/mapping/complex.ts#L50-L57',
676676
'_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L66-L68',
677-
'_types.mapping.DoubleNumberProperty': '_types/mapping/core.ts#L166-L169',
677+
'_types.mapping.DoubleNumberProperty': '_types/mapping/core.ts#L168-L171',
678678
'_types.mapping.DoubleRangeProperty': '_types/mapping/range.ts#L42-L44',
679679
'_types.mapping.DynamicMapping': '_types/mapping/dynamic-template.ts#L37-L46',
680-
'_types.mapping.DynamicProperty': '_types/mapping/core.ts#L313-L343',
680+
'_types.mapping.DynamicProperty': '_types/mapping/core.ts#L315-L345',
681681
'_types.mapping.DynamicTemplate': '_types/mapping/dynamic-template.ts#L22-L30',
682682
'_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L48-L51',
683683
'_types.mapping.FieldMapping': '_types/mapping/meta-fields.ts#L24-L27',
684684
'_types.mapping.FieldNamesField': '_types/mapping/meta-fields.ts#L42-L44',
685-
'_types.mapping.FieldType': '_types/mapping/Property.ts#L73-L116',
685+
'_types.mapping.FieldType': '_types/mapping/Property.ts#L73-L117',
686686
'_types.mapping.FlattenedProperty': '_types/mapping/complex.ts#L25-L36',
687-
'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L156-L159',
687+
'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L158-L161',
688688
'_types.mapping.FloatRangeProperty': '_types/mapping/range.ts#L46-L48',
689689
'_types.mapping.GeoOrientation': '_types/mapping/geo.ts#L34-L39',
690690
'_types.mapping.GeoPointProperty': '_types/mapping/geo.ts#L24-L32',
691691
'_types.mapping.GeoShapeProperty': '_types/mapping/geo.ts#L41-L54',
692692
'_types.mapping.GeoStrategy': '_types/mapping/geo.ts#L56-L59',
693-
'_types.mapping.HalfFloatNumberProperty': '_types/mapping/core.ts#L161-L164',
693+
'_types.mapping.HalfFloatNumberProperty': '_types/mapping/core.ts#L163-L166',
694694
'_types.mapping.HistogramProperty': '_types/mapping/specialized.ts#L53-L56',
695695
'_types.mapping.IndexField': '_types/mapping/meta-fields.ts#L46-L48',
696-
'_types.mapping.IndexOptions': '_types/mapping/core.ts#L273-L278',
697-
'_types.mapping.IntegerNumberProperty': '_types/mapping/core.ts#L171-L174',
696+
'_types.mapping.IndexOptions': '_types/mapping/core.ts#L275-L280',
697+
'_types.mapping.IntegerNumberProperty': '_types/mapping/core.ts#L173-L176',
698698
'_types.mapping.IntegerRangeProperty': '_types/mapping/range.ts#L50-L52',
699699
'_types.mapping.IpProperty': '_types/mapping/specialized.ts#L58-L64',
700700
'_types.mapping.IpRangeProperty': '_types/mapping/range.ts#L54-L56',
701701
'_types.mapping.JoinProperty': '_types/mapping/core.ts#L123-L126',
702-
'_types.mapping.KeywordProperty': '_types/mapping/core.ts#L128-L138',
703-
'_types.mapping.LongNumberProperty': '_types/mapping/core.ts#L176-L179',
702+
'_types.mapping.KeywordProperty': '_types/mapping/core.ts#L128-L140',
703+
'_types.mapping.LongNumberProperty': '_types/mapping/core.ts#L178-L181',
704704
'_types.mapping.LongRangeProperty': '_types/mapping/range.ts#L58-L60',
705-
'_types.mapping.MatchOnlyTextProperty': '_types/mapping/core.ts#L246-L271',
705+
'_types.mapping.MatchOnlyTextProperty': '_types/mapping/core.ts#L248-L273',
706706
'_types.mapping.MatchType': '_types/mapping/dynamic-template.ts#L32-L35',
707707
'_types.mapping.Murmur3HashProperty': '_types/mapping/specialized.ts#L66-L68',
708708
'_types.mapping.NestedProperty': '_types/mapping/complex.ts#L38-L43',
709-
'_types.mapping.NumberPropertyBase': '_types/mapping/core.ts#L140-L143',
709+
'_types.mapping.NumberPropertyBase': '_types/mapping/core.ts#L142-L145',
710710
'_types.mapping.ObjectProperty': '_types/mapping/complex.ts#L45-L48',
711-
'_types.mapping.OnScriptError': '_types/mapping/core.ts#L145-L148',
712-
'_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L214-L216',
711+
'_types.mapping.OnScriptError': '_types/mapping/core.ts#L147-L150',
712+
'_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L216-L218',
713713
'_types.mapping.PointProperty': '_types/mapping/geo.ts#L66-L71',
714714
'_types.mapping.Property': '_types/mapping/Property.ts#L55-L71',
715715
'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L43-L53',
716716
'_types.mapping.RangePropertyBase': '_types/mapping/range.ts#L23-L27',
717-
'_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L218-L221',
718-
'_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L223-L226',
717+
'_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L220-L223',
718+
'_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L225-L228',
719719
'_types.mapping.RoutingField': '_types/mapping/meta-fields.ts#L50-L52',
720720
'_types.mapping.RuntimeField': '_types/mapping/RuntimeFields.ts#L26-L30',
721721
'_types.mapping.RuntimeFieldType': '_types/mapping/RuntimeFields.ts#L32-L40',
722-
'_types.mapping.ScaledFloatNumberProperty': '_types/mapping/core.ts#L196-L201',
723-
'_types.mapping.SearchAsYouTypeProperty': '_types/mapping/core.ts#L228-L238',
722+
'_types.mapping.ScaledFloatNumberProperty': '_types/mapping/core.ts#L198-L203',
723+
'_types.mapping.SearchAsYouTypeProperty': '_types/mapping/core.ts#L230-L240',
724724
'_types.mapping.ShapeProperty': '_types/mapping/geo.ts#L73-L85',
725-
'_types.mapping.ShortNumberProperty': '_types/mapping/core.ts#L181-L184',
725+
'_types.mapping.ShortNumberProperty': '_types/mapping/core.ts#L183-L186',
726726
'_types.mapping.SizeField': '_types/mapping/meta-fields.ts#L54-L56',
727727
'_types.mapping.SourceField': '_types/mapping/meta-fields.ts#L58-L64',
728-
'_types.mapping.StandardNumberProperty': '_types/mapping/core.ts#L150-L154',
728+
'_types.mapping.StandardNumberProperty': '_types/mapping/core.ts#L152-L156',
729729
'_types.mapping.SuggestContext': '_types/mapping/specialized.ts#L36-L41',
730730
'_types.mapping.TermVectorOption': '_types/mapping/TermVectorOption.ts#L20-L28',
731-
'_types.mapping.TextIndexPrefixes': '_types/mapping/core.ts#L280-L283',
732-
'_types.mapping.TextProperty': '_types/mapping/core.ts#L285-L301',
731+
'_types.mapping.TextIndexPrefixes': '_types/mapping/core.ts#L282-L285',
732+
'_types.mapping.TextProperty': '_types/mapping/core.ts#L287-L303',
733733
'_types.mapping.TokenCountProperty': '_types/mapping/specialized.ts#L70-L77',
734734
'_types.mapping.TypeMapping': '_types/mapping/TypeMapping.ts#L34-L51',
735-
'_types.mapping.UnsignedLongNumberProperty': '_types/mapping/core.ts#L191-L194',
736-
'_types.mapping.VersionProperty': '_types/mapping/core.ts#L303-L305',
737-
'_types.mapping.WildcardProperty': '_types/mapping/core.ts#L307-L311',
735+
'_types.mapping.UnsignedLongNumberProperty': '_types/mapping/core.ts#L193-L196',
736+
'_types.mapping.VersionProperty': '_types/mapping/core.ts#L305-L307',
737+
'_types.mapping.WildcardProperty': '_types/mapping/core.ts#L309-L313',
738738
'_types.query_dsl.BoolQuery': '_types/query_dsl/compound.ts#L28-L34',
739739
'_types.query_dsl.BoostingQuery': '_types/query_dsl/compound.ts#L36-L40',
740740
'_types.query_dsl.ChildScoreMode': '_types/query_dsl/joining.ts#L25-L39',
@@ -2351,10 +2351,10 @@
23512351
if (hash.length > 1) {
23522352
hash = hash.substring(1);
23532353
}
2354-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/6991ecdf8b8ea1a434308721fb680058d2aef57d/specification/" + (paths[hash] || "");
2354+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/3458c5d2594e7ad33da1b128469faa09881bbead/specification/" + (paths[hash] || "");
23552355
</script>
23562356
</head>
23572357
<body>
2358-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/6991ecdf8b8ea1a434308721fb680058d2aef57d/specification/">Elasticsearch API specification</a>.
2358+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/3458c5d2594e7ad33da1b128469faa09881bbead/specification/">Elasticsearch API specification</a>.
23592359
</body>
23602360
</html>

0 commit comments

Comments
 (0)