use of cz.mzk.recordmanager.server.index.enrich.LazyFulltextFieldImpl in project RecordManager2 by moravianlibrary.
the class SolrServerFacadeImpl method indexLazyFulltext.
private void indexLazyFulltext(Collection<SolrInputDocument> documents, int commitWithinMs) throws SolrServerException {
for (SolrInputDocument document : documents) {
boolean carryOn = true;
while (carryOn) {
try {
LazyFulltextFieldImpl fulltext = (LazyFulltextFieldImpl) document.getFieldValue(SolrFieldConstants.FULLTEXT_FIELD);
document.setField(SolrFieldConstants.FULLTEXT_FIELD, fulltext.getContent());
server.add(document, commitWithinMs);
exceptionHandler.ok();
carryOn = false;
} catch (SolrException | SolrServerException | IOException ex) {
carryOn = exceptionHandler.handle(ex, Collections.singletonList(document)) == Action.RETRY;
} finally {
// to enable garbage collection
document.removeField(SolrFieldConstants.FULLTEXT_FIELD);
}
}
}
}
Aggregations