totalRetrieved += retrieved;
logger.info(String.format("Returned %d results", retrieved));
int added = 0;
for (int i = 0; i < retrieved && added < capacity; i++) {
DocumentScoreInfo dsi = results.get(i);
Document document = collection.document(dsi.document);
System.err.println("URI: " + document.uri());
System.err.println("URI["+dsi.document+"]: " + collection.metadata(dsi.document).get(PropertyBasedDocumentFactory.MetadataKeys.URI));
final String docno = (String) collection.metadata(dsi.document).get(PropertyBasedDocumentFactory.MetadataKeys.URI);
// If it was not a discarded document