if (alternateVersions.getValues().size() > 0) {
resourceMetadata.add(alternateVersions);
}
// Write the resource to the index
documents.add(new ElasticSearchDocument(r.getURI(), resourceMetadata));
}
// Now update all documents at once
try {
update(documents.toArray(new ElasticSearchDocument[documents.size()]));