protected ShortFieldMapper(
     Names names,
     int precisionStep,
     String fuzzyFactor,
     Field.Index index,
     Field.Store store,
     float boost,
     boolean omitNorms,
     IndexOptions indexOptions,
     Short nullValue,
     boolean ignoreMalformed) {
   super(
       names,
       precisionStep,
       fuzzyFactor,
       index,
       store,
       boost,
       omitNorms,
       indexOptions,
       ignoreMalformed,
       new NamedAnalyzer("_short/" + precisionStep, new NumericIntegerAnalyzer(precisionStep)),
       new NamedAnalyzer("_short/max", new NumericIntegerAnalyzer(Integer.MAX_VALUE)));
   this.nullValue = nullValue;
   this.nullValueAsString = nullValue == null ? null : nullValue.toString();
 }
 @Override
 public String numericAsString() {
   return Short.toString(number);
 }
 @Override
 protected Fieldable innerParseCreateField(ParseContext context) throws IOException {
   short value;
   float boost = this.boost;
   if (context.externalValueSet()) {
     Object externalValue = context.externalValue();
     if (externalValue == null) {
       if (nullValue == null) {
         return null;
       }
       value = nullValue;
     } else if (externalValue instanceof String) {
       String sExternalValue = (String) externalValue;
       if (sExternalValue.length() == 0) {
         if (nullValue == null) {
           return null;
         }
         value = nullValue;
       } else {
         value = Short.parseShort(sExternalValue);
       }
     } else {
       value = ((Number) externalValue).shortValue();
     }
     if (context.includeInAll(includeInAll, this)) {
       context.allEntries().addText(names.fullName(), Short.toString(value), boost);
     }
   } else {
     XContentParser parser = context.parser();
     if (parser.currentToken() == XContentParser.Token.VALUE_NULL
         || (parser.currentToken() == XContentParser.Token.VALUE_STRING
             && parser.textLength() == 0)) {
       if (nullValue == null) {
         return null;
       }
       value = nullValue;
       if (nullValueAsString != null && (context.includeInAll(includeInAll, this))) {
         context.allEntries().addText(names.fullName(), nullValueAsString, boost);
       }
     } else if (parser.currentToken() == XContentParser.Token.START_OBJECT) {
       XContentParser.Token token;
       String currentFieldName = null;
       Short objValue = nullValue;
       while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
         if (token == XContentParser.Token.FIELD_NAME) {
           currentFieldName = parser.currentName();
         } else {
           if ("value".equals(currentFieldName) || "_value".equals(currentFieldName)) {
             if (parser.currentToken() != XContentParser.Token.VALUE_NULL) {
               objValue = parser.shortValue();
             }
           } else if ("boost".equals(currentFieldName) || "_boost".equals(currentFieldName)) {
             boost = parser.floatValue();
           }
         }
       }
       if (objValue == null) {
         // no value
         return null;
       }
       value = objValue;
     } else {
       value = parser.shortValue();
       if (context.includeInAll(includeInAll, this)) {
         context.allEntries().addText(names.fullName(), parser.text(), boost);
       }
     }
   }
   CustomShortNumericField field = new CustomShortNumericField(this, value);
   field.setBoost(boost);
   return field;
 }