this.analyzer = analyzer;
}
@Override
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException {
ValueAndBoost valueAndBoost = StringFieldMapper.parseCreateFieldForString(context, null /* Out null value is an int so we convert*/, boost);
if (valueAndBoost.value() == null && nullValue() == null) {
return;
}
if (fieldType.indexOptions() != IndexOptions.NONE || fieldType.stored() || hasDocValues()) {
int count;
if (valueAndBoost.value() == null) {
count = nullValue();
} else {
count = countPositions(analyzer.analyzer().tokenStream(name(), valueAndBoost.value()));
}
addIntegerFields(context, fields, count, valueAndBoost.boost());
}
if (fields.isEmpty()) {
context.ignoredValue(names.indexName(), valueAndBoost.value());
}
}