req.setAttributeArray(prefillAttributes);
UseCase prefillCase = MonitorFactory.startUseCase("indexSlice(" + crid + ").prefillAttributes");
rp.fillAttributes(slice, req, idAttribute);
prefillCase.stop();
for (Resolvable objectToIndex : slice) {
CRResolvableBean bean = new CRResolvableBean(objectToIndex, prefillAttributes);
UseCase bcase = MonitorFactory.startUseCase("indexSlice(" + crid + ").indexBean");
try {
//CALL PRE INDEX PROCESSORS/TRANSFORMERS
//TODO This could be optimized for multicore servers with
//a map/reduce algorithm
if (transformerlist != null) {
for (ContentTransformer transformer : transformerlist) {
try {
if (transformer.match(bean)) {
String msg = "TRANSFORMER: " + transformer.getTransformerKey() + "; BEAN: " + bean.get(idAttribute);
status.setCurrentStatusString(msg);
ContentTransformer.getLogger().debug(msg);
if (transformer instanceof AbstractLuceneMonitoringTransformer) {
((AbstractLuceneMonitoringTransformer) transformer).processBeanWithMonitoring(bean, indexWriter);
} else {
transformer.processBeanWithMonitoring(bean);
}
}
} catch (Exception e) {
//TODO Remember broken files
log.error("Error while Transforming Contentbean" + "with id: " + bean.get(idAttribute) + " Transformer: "
+ transformer.getTransformerKey() + " " + transformer.getClass().getName(), e);
}
}
}
Term idTerm = new Term(idAttribute, bean.getString(idAttribute));
Document docToUpdate = getUniqueDocument(indexReader, idTerm, crid);
// get the category paths for the facets
CategoryDocumentBuilder categoryDocBuilder = null;
if (useFacets && taxonomyAccessor != null && taxonomyWriter != null) {