hitField = new InternalSearchHitField(field.name(), new ArrayList<>(2));
hitContext.hit().fields().put(field.name(), hitField);
}
FieldMapper mapper = context.mapperService().smartNameFieldMapper(field.name());
if (mapper != null) {
AtomicFieldData data = context.fieldData().getForField(mapper).load(hitContext.readerContext());
ScriptDocValues values = data.getScriptValues();
values.setNextDocId(hitContext.docId());
hitField.values().addAll(values.getValues());
}
}
}