private Tuple addDocumentMetatdataFields(DocumentMetadata metadata,
Tuple output) throws ExecException {
output.set(fieldNumberMap.get(C.KEY), metadata.getKey());
appendToOutput(output, C.TITLE, metadata.getBasicMetadata()
.getTitleList());
appendToOutput(output, C.ABSTRACT_TEXT,
metadata.getDocumentAbstractList());
List<String> al = new ArrayList<String>();
for (KeywordsList kl : metadata.getKeywordsList()) {
for (String s : kl.getKeywordsList()) {
al.add(removeAllPigUnfriendlySigns(s));
}
}
output.set(fieldNumberMap.get(C.KEYWORDS), listToDataBag(al));
List<String> authorKeys = new ArrayList<String>();
List<String> authorNames = new ArrayList<String>();
for (Author author : metadata.getBasicMetadata().getAuthorList()) {
authorKeys.add(author.getKey());
authorNames.add(author.getName());
}
output.set(fieldNumberMap.get(C.CONTRIBUTORS),
listToDataBag(authorKeys, authorNames));
return output;
}