Skip to content

Commit bd8d2f6

Browse files
authored
Issue fixing (#847)
* fixing issues * codestyle
1 parent c430f6d commit bd8d2f6

23 files changed

+288
-192
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ public class RrfRank extends RankBase implements RankVariant, JsonpSerializable
6161
private final Long rankConstant;
6262

6363
@Nullable
64-
private final Long windowSize;
64+
private final Long rankWindowSize;
6565

6666
// ---------------------------------------------------------------------------------------------
6767

6868
private RrfRank(Builder builder) {
6969

7070
this.rankConstant = builder.rankConstant;
71-
this.windowSize = builder.windowSize;
71+
this.rankWindowSize = builder.rankWindowSize;
7272

7373
}
7474

@@ -98,11 +98,11 @@ public final Long rankConstant() {
9898
/**
9999
* Size of the individual result sets per query
100100
* <p>
101-
* API name: {@code window_size}
101+
* API name: {@code rank_window_size}
102102
*/
103103
@Nullable
104-
public final Long windowSize() {
105-
return this.windowSize;
104+
public final Long rankWindowSize() {
105+
return this.rankWindowSize;
106106
}
107107

108108
/**
@@ -121,9 +121,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
121121
generator.write(this.rankConstant);
122122

123123
}
124-
if (this.windowSize != null) {
125-
generator.writeKey("window_size");
126-
generator.write(this.windowSize);
124+
if (this.rankWindowSize != null) {
125+
generator.writeKey("rank_window_size");
126+
generator.write(this.rankWindowSize);
127127

128128
}
129129

@@ -145,7 +145,7 @@ public static class Builder extends RankBase.AbstractBuilder<Builder> implements
145145
private Long rankConstant;
146146

147147
@Nullable
148-
private Long windowSize;
148+
private Long rankWindowSize;
149149

150150
/**
151151
* How much influence documents in individual result sets per query have over
@@ -161,10 +161,10 @@ public final Builder rankConstant(@Nullable Long value) {
161161
/**
162162
* Size of the individual result sets per query
163163
* <p>
164-
* API name: {@code window_size}
164+
* API name: {@code rank_window_size}
165165
*/
166-
public final Builder windowSize(@Nullable Long value) {
167-
this.windowSize = value;
166+
public final Builder rankWindowSize(@Nullable Long value) {
167+
this.rankWindowSize = value;
168168
return this;
169169
}
170170

@@ -197,7 +197,7 @@ public RrfRank build() {
197197
protected static void setupRrfRankDeserializer(ObjectDeserializer<RrfRank.Builder> op) {
198198

199199
op.add(Builder::rankConstant, JsonpDeserializer.longDeserializer(), "rank_constant");
200-
op.add(Builder::windowSize, JsonpDeserializer.longDeserializer(), "window_size");
200+
op.add(Builder::rankWindowSize, JsonpDeserializer.longDeserializer(), "rank_window_size");
201201

202202
}
203203

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

Lines changed: 57 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import co.elastic.clients.util.ObjectBuilder;
3131
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3232
import jakarta.json.stream.JsonGenerator;
33+
import java.lang.Float;
3334
import java.lang.Integer;
3435
import java.lang.String;
3536
import java.util.Objects;
@@ -63,17 +64,23 @@
6364
public class DenseVectorIndexOptions implements JsonpSerializable {
6465
private final String type;
6566

66-
private final int m;
67+
@Nullable
68+
private final Integer m;
6769

68-
private final int efConstruction;
70+
@Nullable
71+
private final Integer efConstruction;
72+
73+
@Nullable
74+
private final Float confidenceInterval;
6975

7076
// ---------------------------------------------------------------------------------------------
7177

7278
private DenseVectorIndexOptions(Builder builder) {
7379

7480
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
75-
this.m = ApiTypeHelper.requireNonNull(builder.m, this, "m");
76-
this.efConstruction = ApiTypeHelper.requireNonNull(builder.efConstruction, this, "efConstruction");
81+
this.m = builder.m;
82+
this.efConstruction = builder.efConstruction;
83+
this.confidenceInterval = builder.confidenceInterval;
7784

7885
}
7986

@@ -89,19 +96,29 @@ public final String type() {
8996
}
9097

9198
/**
92-
* Required - API name: {@code m}
99+
* API name: {@code m}
93100
*/
94-
public final int m() {
101+
@Nullable
102+
public final Integer m() {
95103
return this.m;
96104
}
97105

98106
/**
99-
* Required - API name: {@code ef_construction}
107+
* API name: {@code ef_construction}
100108
*/
101-
public final int efConstruction() {
109+
@Nullable
110+
public final Integer efConstruction() {
102111
return this.efConstruction;
103112
}
104113

114+
/**
115+
* API name: {@code confidence_interval}
116+
*/
117+
@Nullable
118+
public final Float confidenceInterval() {
119+
return this.confidenceInterval;
120+
}
121+
105122
/**
106123
* Serialize this object to JSON.
107124
*/
@@ -116,11 +133,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
116133
generator.writeKey("type");
117134
generator.write(this.type);
118135

119-
generator.writeKey("m");
120-
generator.write(this.m);
136+
if (this.m != null) {
137+
generator.writeKey("m");
138+
generator.write(this.m);
139+
140+
}
141+
if (this.efConstruction != null) {
142+
generator.writeKey("ef_construction");
143+
generator.write(this.efConstruction);
144+
145+
}
146+
if (this.confidenceInterval != null) {
147+
generator.writeKey("confidence_interval");
148+
generator.write(this.confidenceInterval);
121149

122-
generator.writeKey("ef_construction");
123-
generator.write(this.efConstruction);
150+
}
124151

125152
}
126153

@@ -140,10 +167,15 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
140167
ObjectBuilder<DenseVectorIndexOptions> {
141168
private String type;
142169

170+
@Nullable
143171
private Integer m;
144172

173+
@Nullable
145174
private Integer efConstruction;
146175

176+
@Nullable
177+
private Float confidenceInterval;
178+
147179
/**
148180
* Required - API name: {@code type}
149181
*/
@@ -153,21 +185,29 @@ public final Builder type(String value) {
153185
}
154186

155187
/**
156-
* Required - API name: {@code m}
188+
* API name: {@code m}
157189
*/
158-
public final Builder m(int value) {
190+
public final Builder m(@Nullable Integer value) {
159191
this.m = value;
160192
return this;
161193
}
162194

163195
/**
164-
* Required - API name: {@code ef_construction}
196+
* API name: {@code ef_construction}
165197
*/
166-
public final Builder efConstruction(int value) {
198+
public final Builder efConstruction(@Nullable Integer value) {
167199
this.efConstruction = value;
168200
return this;
169201
}
170202

203+
/**
204+
* API name: {@code confidence_interval}
205+
*/
206+
public final Builder confidenceInterval(@Nullable Float value) {
207+
this.confidenceInterval = value;
208+
return this;
209+
}
210+
171211
@Override
172212
protected Builder self() {
173213
return this;
@@ -200,6 +240,7 @@ protected static void setupDenseVectorIndexOptionsDeserializer(
200240
op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type");
201241
op.add(Builder::m, JsonpDeserializer.integerDeserializer(), "m");
202242
op.add(Builder::efConstruction, JsonpDeserializer.integerDeserializer(), "ef_construction");
243+
op.add(Builder::confidenceInterval, JsonpDeserializer.floatDeserializer(), "confidence_interval");
203244

204245
}
205246

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
public class TermvectorsResponse implements JsonpSerializable {
6666
private final boolean found;
6767

68+
@Nullable
6869
private final String id;
6970

7071
private final String index;
@@ -80,7 +81,7 @@ public class TermvectorsResponse implements JsonpSerializable {
8081
private TermvectorsResponse(Builder builder) {
8182

8283
this.found = ApiTypeHelper.requireNonNull(builder.found, this, "found");
83-
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
84+
this.id = builder.id;
8485
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
8586
this.termVectors = ApiTypeHelper.unmodifiable(builder.termVectors);
8687
this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took");
@@ -100,8 +101,9 @@ public final boolean found() {
100101
}
101102

102103
/**
103-
* Required - API name: {@code _id}
104+
* API name: {@code _id}
104105
*/
106+
@Nullable
105107
public final String id() {
106108
return this.id;
107109
}
@@ -148,9 +150,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
148150
generator.writeKey("found");
149151
generator.write(this.found);
150152

151-
generator.writeKey("_id");
152-
generator.write(this.id);
153+
if (this.id != null) {
154+
generator.writeKey("_id");
155+
generator.write(this.id);
153156

157+
}
154158
generator.writeKey("_index");
155159
generator.write(this.index);
156160

@@ -189,6 +193,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
189193
ObjectBuilder<TermvectorsResponse> {
190194
private Boolean found;
191195

196+
@Nullable
192197
private String id;
193198

194199
private String index;
@@ -209,9 +214,9 @@ public final Builder found(boolean value) {
209214
}
210215

211216
/**
212-
* Required - API name: {@code _id}
217+
* API name: {@code _id}
213218
*/
214-
public final Builder id(String value) {
219+
public final Builder id(@Nullable String value) {
215220
this.id = value;
216221
return this;
217222
}

java-client/src/main/java/co/elastic/clients/elasticsearch/core/mtermvectors/MultiTermVectorsResult.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
*/
6666
@JsonpDeserializable
6767
public class MultiTermVectorsResult implements JsonpSerializable {
68+
@Nullable
6869
private final String id;
6970

7071
private final String index;
@@ -87,7 +88,7 @@ public class MultiTermVectorsResult implements JsonpSerializable {
8788

8889
private MultiTermVectorsResult(Builder builder) {
8990

90-
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
91+
this.id = builder.id;
9192
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
9293
this.version = builder.version;
9394
this.took = builder.took;
@@ -102,8 +103,9 @@ public static MultiTermVectorsResult of(Function<Builder, ObjectBuilder<MultiTer
102103
}
103104

104105
/**
105-
* Required - API name: {@code _id}
106+
* API name: {@code _id}
106107
*/
108+
@Nullable
107109
public final String id() {
108110
return this.id;
109111
}
@@ -165,9 +167,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
165167

166168
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
167169

168-
generator.writeKey("_id");
169-
generator.write(this.id);
170+
if (this.id != null) {
171+
generator.writeKey("_id");
172+
generator.write(this.id);
170173

174+
}
171175
generator.writeKey("_index");
172176
generator.write(this.index);
173177

@@ -219,6 +223,7 @@ public String toString() {
219223
public static class Builder extends WithJsonObjectBuilderBase<Builder>
220224
implements
221225
ObjectBuilder<MultiTermVectorsResult> {
226+
@Nullable
222227
private String id;
223228

224229
private String index;
@@ -239,9 +244,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
239244
private ErrorCause error;
240245

241246
/**
242-
* Required - API name: {@code _id}
247+
* API name: {@code _id}
243248
*/
244-
public final Builder id(String value) {
249+
public final Builder id(@Nullable String value) {
245250
this.id = value;
246251
return this;
247252
}

0 commit comments

Comments
 (0)