Skip to content

Commit 1a14271

Browse files
authoredMar 20, 2025··
Support normalizer on wildcard field (#1489)
Resolves #1153 Signed-off-by: Lukáš Křečan <lukas@krecan.net> Signed-off-by: Lukas Krecan <lukas@krecan.net>
1 parent 2f8f390 commit 1a14271

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ This section is for maintaining a changelog for all breaking changes for the cli
4444

4545
## [Unreleased 2.x]
4646
### Added
47+
- Added `normalizer` to wildcard field ([#1489](https://github.com/opensearch-project/opensearch-java/pull/1489))
4748

4849
### Dependencies
4950

‎java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/WildcardProperty.java

+33-1
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,17 @@ public class WildcardProperty extends DocValuesPropertyBase
6060
PropertyVariant,
6161
ToCopyableBuilder<WildcardProperty.Builder, WildcardProperty> {
6262

63+
@Nullable
64+
private final String normalizer;
65+
6366
@Nullable
6467
private final String nullValue;
6568

6669
// ---------------------------------------------------------------------------------------------
6770

6871
private WildcardProperty(Builder builder) {
6972
super(builder);
73+
this.normalizer = builder.normalizer;
7074
this.nullValue = builder.nullValue;
7175
}
7276

@@ -82,6 +86,14 @@ public Property.Kind _propertyKind() {
8286
return Property.Kind.Wildcard;
8387
}
8488

89+
/**
90+
* API name: {@code normalizer}
91+
*/
92+
@Nullable
93+
public final String normalizer() {
94+
return this.normalizer;
95+
}
96+
8597
/**
8698
* API name: {@code null_value}
8799
*/
@@ -93,6 +105,11 @@ public final String nullValue() {
93105
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
94106
generator.write("type", "wildcard");
95107
super.serializeInternal(generator, mapper);
108+
if (this.normalizer != null) {
109+
generator.writeKey("normalizer");
110+
generator.write(this.normalizer);
111+
}
112+
96113
if (this.nullValue != null) {
97114
generator.writeKey("null_value");
98115
generator.write(this.nullValue);
@@ -119,17 +136,21 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder<Builde
119136
implements
120137
CopyableBuilder<Builder, WildcardProperty> {
121138
@Nullable
139+
private String normalizer;
140+
@Nullable
122141
private String nullValue;
123142

124143
public Builder() {}
125144

126145
private Builder(WildcardProperty o) {
127146
super(o);
147+
this.normalizer = o.normalizer;
128148
this.nullValue = o.nullValue;
129149
}
130150

131151
private Builder(Builder o) {
132152
super(o);
153+
this.normalizer = o.normalizer;
133154
this.nullValue = o.nullValue;
134155
}
135156

@@ -145,6 +166,15 @@ protected Builder self() {
145166
return this;
146167
}
147168

169+
/**
170+
* API name: {@code normalizer}
171+
*/
172+
@Nonnull
173+
public final Builder normalizer(@Nullable String value) {
174+
this.normalizer = value;
175+
return this;
176+
}
177+
148178
/**
149179
* API name: {@code null_value}
150180
*/
@@ -180,6 +210,7 @@ public WildcardProperty build() {
180210

181211
protected static void setupWildcardPropertyDeserializer(ObjectDeserializer<WildcardProperty.Builder> op) {
182212
setupDocValuesPropertyBaseDeserializer(op);
213+
op.add(Builder::normalizer, JsonpDeserializer.stringDeserializer(), "normalizer");
183214
op.add(Builder::nullValue, JsonpDeserializer.stringDeserializer(), "null_value");
184215

185216
op.ignore("type");
@@ -188,6 +219,7 @@ protected static void setupWildcardPropertyDeserializer(ObjectDeserializer<Wildc
188219
@Override
189220
public int hashCode() {
190221
int result = super.hashCode();
222+
result = 31 * result + Objects.hashCode(this.normalizer);
191223
result = 31 * result + Objects.hashCode(this.nullValue);
192224
return result;
193225
}
@@ -200,6 +232,6 @@ public boolean equals(Object o) {
200232
if (this == o) return true;
201233
if (o == null || this.getClass() != o.getClass()) return false;
202234
WildcardProperty other = (WildcardProperty) o;
203-
return Objects.equals(this.nullValue, other.nullValue);
235+
return Objects.equals(this.normalizer, other.normalizer) && Objects.equals(this.nullValue, other.nullValue);
204236
}
205237
}

‎java-codegen/opensearch-openapi.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -43665,6 +43665,8 @@ components:
4366543665
- wildcard
4366643666
null_value:
4366743667
type: string
43668+
normalizer:
43669+
type: string
4366843670
required:
4366943671
- type
4367043672
_common.mapping___XyPointProperty:

0 commit comments

Comments
 (0)
Please sign in to comment.