@@ -116,7 +116,7 @@ public static class Builder extends FieldMapper.Builder {
116
116
private final ScriptCompiler scriptCompiler ;
117
117
private final NumberType type ;
118
118
119
- private final Parameter < Boolean > allowMultipleValues ;
119
+ private boolean allowMultipleValues = true ;
120
120
private final Version indexCreatedVersion ;
121
121
122
122
public Builder (String name , NumberType type , ScriptCompiler compiler , Settings settings , Version indexCreatedVersion ) {
@@ -189,8 +189,6 @@ public Builder(
189
189
190
190
this .script .precludesParameters (ignoreMalformed , coerce , nullValue );
191
191
addScriptValidation (script , indexed , hasDocValues );
192
-
193
- this .allowMultipleValues = Parameter .boolParam ("allow_multiple_values" , false , m -> toType (m ).allowMultipleValues , true );
194
192
}
195
193
196
194
Builder nullValue (Number number ) {
@@ -221,7 +219,7 @@ public Builder metric(MetricType metric) {
221
219
}
222
220
223
221
public Builder allowMultipleValues (boolean allowMultipleValues ) {
224
- this .allowMultipleValues . setValue ( allowMultipleValues ) ;
222
+ this .allowMultipleValues = allowMultipleValues ;
225
223
return this ;
226
224
}
227
225
@@ -238,8 +236,7 @@ protected Parameter<?>[] getParameters() {
238
236
onScriptError ,
239
237
meta ,
240
238
dimension ,
241
- metric ,
242
- allowMultipleValues };
239
+ metric };
243
240
}
244
241
245
242
@ Override
@@ -1555,7 +1552,7 @@ private NumberFieldMapper(String simpleName, MappedFieldType mappedFieldType, Mu
1555
1552
this .scriptCompiler = builder .scriptCompiler ;
1556
1553
this .script = builder .script .getValue ();
1557
1554
this .metricType = builder .metric .getValue ();
1558
- this .allowMultipleValues = builder .allowMultipleValues . get () ;
1555
+ this .allowMultipleValues = builder .allowMultipleValues ;
1559
1556
this .indexCreatedVersion = builder .indexCreatedVersion ;
1560
1557
}
1561
1558
@@ -1626,8 +1623,11 @@ private void indexValue(DocumentParserContext context, Number numericValue) {
1626
1623
// the last field is the current field, Add to the key map, so that we can validate if it has been added
1627
1624
List <IndexableField > fields = context .doc ().getFields ();
1628
1625
IndexableField last = fields .get (fields .size () - 1 );
1629
- assert last .name ().equals (fieldType ().name ())
1630
- : "last field name [" + last .name () + "] mis match field name [" + fieldType ().name () + "]" ;
1626
+ assert last .name ().equals (fieldType ().name ()) : "last field name ["
1627
+ + last .name ()
1628
+ + "] mis match field name ["
1629
+ + fieldType ().name ()
1630
+ + "]" ;
1631
1631
context .doc ().onlyAddKey (fieldType ().name (), fields .get (fields .size () - 1 ));
1632
1632
}
1633
1633
0 commit comments