24
24
package co .elastic .clients .elasticsearch .core .search ;
25
25
26
26
import co .elastic .clients .elasticsearch ._types .query_dsl .Query ;
27
+ import co .elastic .clients .json .JsonData ;
27
28
import co .elastic .clients .json .JsonpDeserializable ;
28
29
import co .elastic .clients .json .JsonpDeserializer ;
29
30
import co .elastic .clients .json .JsonpMapper ;
38
39
import java .lang .Integer ;
39
40
import java .lang .String ;
40
41
import java .util .List ;
41
- import java .util .Objects ;
42
+ import java .util .Map ;
42
43
import java .util .function .Function ;
43
44
import javax .annotation .Nullable ;
44
45
@@ -112,6 +113,10 @@ public class HighlightField implements JsonpSerializable {
112
113
@ Nullable
113
114
private final String type ;
114
115
116
+ @ Nullable
117
+ private final Map <String , JsonData > options ;
118
+
119
+
115
120
// ---------------------------------------------------------------------------------------------
116
121
117
122
private HighlightField (Builder builder ) {
@@ -137,7 +142,7 @@ private HighlightField(Builder builder) {
137
142
this .requireFieldMatch = builder .requireFieldMatch ;
138
143
this .tagsSchema = builder .tagsSchema ;
139
144
this .type = builder .type ;
140
-
145
+ this . options = ApiTypeHelper . unmodifiable ( builder . options );
141
146
}
142
147
143
148
public static HighlightField of (Function <Builder , ObjectBuilder <HighlightField >> fn ) {
@@ -309,6 +314,14 @@ public final String type() {
309
314
return this .type ;
310
315
}
311
316
317
+ /**
318
+ * API name: {@code options}
319
+ */
320
+ @ Nullable
321
+ public final Map <String , JsonData > options () {
322
+ return this .options ;
323
+ }
324
+
312
325
/**
313
326
* Serialize this object to JSON.
314
327
*/
@@ -436,6 +449,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
436
449
generator .write (this .type );
437
450
438
451
}
452
+ if (ApiTypeHelper .isDefined (this .options )) {
453
+ generator .writeKey ("options" );
454
+ generator .writeStartObject ();
455
+ for (Map .Entry <String , JsonData > item0 : this .options .entrySet ()) {
456
+ generator .writeKey (item0 .getKey ());
457
+ item0 .getValue ().serialize (generator , mapper );
458
+
459
+ }
460
+ generator .writeEnd ();
461
+ }
439
462
440
463
}
441
464
@@ -509,6 +532,9 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder<H
509
532
@ Nullable
510
533
private String type ;
511
534
535
+ @ Nullable
536
+ private Map <String , JsonData > options ;
537
+
512
538
/**
513
539
* API name: {@code boundary_chars}
514
540
*/
@@ -728,6 +754,26 @@ public final Builder type(@Nullable HighlighterType value) {
728
754
return this ;
729
755
}
730
756
757
+ /**
758
+ * API name: {@code options}
759
+ * <p>
760
+ * Adds all entries of <code>map</code> to <code>options</code>.
761
+ */
762
+ public final Builder options (@ Nullable Map <String , JsonData > map ) {
763
+ this .options = _mapPutAll (this .options , map );
764
+ return this ;
765
+ }
766
+
767
+ /**
768
+ * API name: {@code options}
769
+ * <p>
770
+ * Adds an entry to <code>options</code>.
771
+ */
772
+ public final Builder params (String key , JsonData value ) {
773
+ this .options = _mapPut (this .options , key , value );
774
+ return this ;
775
+ }
776
+
731
777
/**
732
778
* Builds a {@link HighlightField}.
733
779
*
@@ -775,6 +821,7 @@ protected static void setupHighlightFieldDeserializer(ObjectDeserializer<Highlig
775
821
op .add (Builder ::requireFieldMatch , JsonpDeserializer .booleanDeserializer (), "require_field_match" );
776
822
op .add (Builder ::tagsSchema , HighlighterTagsSchema ._DESERIALIZER , "tags_schema" );
777
823
op .add (Builder ::type , JsonpDeserializer .stringDeserializer (), "type" );
824
+ op .add (Builder ::options , JsonpDeserializer .stringMapDeserializer (JsonData ._DESERIALIZER ), "options" );
778
825
779
826
}
780
827
0 commit comments