// don't load the source field in this case, makes little sense to get it with all stored fields
if (context.fieldNames().get(0).equals("*")) {
return AllButSourceFieldSelector.INSTANCE;
}
FieldMappersFieldSelector fieldSelector = new FieldMappersFieldSelector();
for (String fieldName : context.fieldNames()) {
FieldMappers x = context.mapperService().smartNameFieldMappers(fieldName);
if (x == null) {
throw new FetchPhaseExecutionException(context, "No mapping for field [" + fieldName + "] in order to load it");
}
fieldSelector.add(x);
}
fieldSelector.add(UidFieldMapper.NAME);
return fieldSelector;
}