Skip to content

Commit c9588aa

Browse files
committed
Fixes from pr 2549 partial 7.17 backport
1 parent c203073 commit c9588aa

File tree

4 files changed

+172
-66
lines changed

4 files changed

+172
-66
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,16 @@
6161
public class AdjacencyMatrixAggregation extends BucketAggregationBase implements AggregationVariant {
6262
private final Map<String, Query> filters;
6363

64+
@Nullable
65+
private final String separator;
66+
6467
// ---------------------------------------------------------------------------------------------
6568

6669
private AdjacencyMatrixAggregation(Builder builder) {
6770
super(builder);
6871

6972
this.filters = ApiTypeHelper.unmodifiable(builder.filters);
73+
this.separator = builder.separator;
7074

7175
}
7276

@@ -89,6 +93,16 @@ public final Map<String, Query> filters() {
8993
return this.filters;
9094
}
9195

96+
/**
97+
* Separator used to concatenate filter names. Defaults to &amp;.
98+
* <p>
99+
* API name: {@code separator}
100+
*/
101+
@Nullable
102+
public final String separator() {
103+
return this.separator;
104+
}
105+
92106
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
93107

94108
super.serializeInternal(generator, mapper);
@@ -103,6 +117,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
103117
generator.writeEnd();
104118

105119
}
120+
if (this.separator != null) {
121+
generator.writeKey("separator");
122+
generator.write(this.separator);
123+
124+
}
106125

107126
}
108127

@@ -118,6 +137,9 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder<Builde
118137
@Nullable
119138
private Map<String, Query> filters;
120139

140+
@Nullable
141+
private String separator;
142+
121143
/**
122144
* API name: {@code filters}
123145
* <p>
@@ -147,6 +169,16 @@ public final Builder filters(String key, Function<Query.Builder, ObjectBuilder<Q
147169
return filters(key, fn.apply(new Query.Builder()).build());
148170
}
149171

172+
/**
173+
* Separator used to concatenate filter names. Defaults to &amp;.
174+
* <p>
175+
* API name: {@code separator}
176+
*/
177+
public final Builder separator(@Nullable String value) {
178+
this.separator = value;
179+
return this;
180+
}
181+
150182
@Override
151183
protected Builder self() {
152184
return this;
@@ -177,6 +209,7 @@ protected static void setupAdjacencyMatrixAggregationDeserializer(
177209
ObjectDeserializer<AdjacencyMatrixAggregation.Builder> op) {
178210
BucketAggregationBase.setupBucketAggregationBaseDeserializer(op);
179211
op.add(Builder::filters, JsonpDeserializer.stringMapDeserializer(Query._DESERIALIZER), "filters");
212+
op.add(Builder::separator, JsonpDeserializer.stringDeserializer(), "separator");
180213

181214
}
182215

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
*/
5959
@JsonpDeserializable
6060
public class DenseVectorProperty extends PropertyBase implements PropertyVariant {
61+
@Nullable
62+
private final String elementType;
63+
6164
@Nullable
6265
private final Integer dims;
6366

@@ -75,6 +78,7 @@ public class DenseVectorProperty extends PropertyBase implements PropertyVariant
7578
private DenseVectorProperty(Builder builder) {
7679
super(builder);
7780

81+
this.elementType = builder.elementType;
7882
this.dims = builder.dims;
7983
this.similarity = builder.similarity;
8084
this.index = builder.index;
@@ -94,6 +98,14 @@ public Property.Kind _propertyKind() {
9498
return Property.Kind.DenseVector;
9599
}
96100

101+
/**
102+
* API name: {@code element_type}
103+
*/
104+
@Nullable
105+
public final String elementType() {
106+
return this.elementType;
107+
}
108+
97109
/**
98110
* API name: {@code dims}
99111
*/
@@ -130,6 +142,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
130142

131143
generator.write("type", "dense_vector");
132144
super.serializeInternal(generator, mapper);
145+
if (this.elementType != null) {
146+
generator.writeKey("element_type");
147+
generator.write(this.elementType);
148+
149+
}
133150
if (this.dims != null) {
134151
generator.writeKey("dims");
135152
generator.write(this.dims);
@@ -162,6 +179,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
162179
public static class Builder extends PropertyBase.AbstractBuilder<Builder>
163180
implements
164181
ObjectBuilder<DenseVectorProperty> {
182+
@Nullable
183+
private String elementType;
184+
165185
@Nullable
166186
private Integer dims;
167187

@@ -174,6 +194,14 @@ public static class Builder extends PropertyBase.AbstractBuilder<Builder>
174194
@Nullable
175195
private DenseVectorIndexOptions indexOptions;
176196

197+
/**
198+
* API name: {@code element_type}
199+
*/
200+
public final Builder elementType(@Nullable String value) {
201+
this.elementType = value;
202+
return this;
203+
}
204+
177205
/**
178206
* API name: {@code dims}
179207
*/
@@ -242,6 +270,7 @@ public DenseVectorProperty build() {
242270

243271
protected static void setupDenseVectorPropertyDeserializer(ObjectDeserializer<DenseVectorProperty.Builder> op) {
244272
PropertyBase.setupPropertyBaseDeserializer(op);
273+
op.add(Builder::elementType, JsonpDeserializer.stringDeserializer(), "element_type");
245274
op.add(Builder::dims, JsonpDeserializer.integerDeserializer(), "dims");
246275
op.add(Builder::similarity, JsonpDeserializer.stringDeserializer(), "similarity");
247276
op.add(Builder::index, JsonpDeserializer.booleanDeserializer(), "index");

0 commit comments

Comments
 (0)