idAttribute);
} else {
log.error("IndexLocation is not created for Lucene. " + "Using the " + CRLuceneIndexJob.class.getName()
+ " requires that you use the " + LuceneIndexLocation.class.getName()
+ ". You can configure another Job by setting the " + IndexLocation.UPDATEJOBCLASS_KEY + " key in your config.");
throw new CRException(new CRError("Error", "IndexLocation is not created for Lucene."));
}
Collection<CRResolvableBean> objectsToIndex = null;
//Clear Index and remove stale Documents
//if (!create) {
log.debug("Will do differential index.");
try {
CRRequest req = new CRRequest();
req.setRequestFilter(rule);
req.set(CR_FIELD_KEY, crid);
status.setCurrentStatusString("Get objects to update " + "in the index ...");
objectsToIndex = getObjectsToUpdate(req, rp, false, luceneIndexUpdateChecker);
} catch (Exception e) {
log.error("ERROR while cleaning index", e);
}
//}
//Obtain accessor and writer after clean
if (indexLocation instanceof LuceneIndexLocation) {
indexAccessor = ((LuceneIndexLocation) indexLocation).getAccessor();
indexWriter = indexAccessor.getWriter();
indexReader = indexAccessor.getReader(false);
useFacets = ((LuceneIndexLocation) indexLocation).useFacets();
if (useFacets) {
taxonomyAccessor = ((LuceneIndexLocation) indexLocation).getTaxonomyAccessor();
taxonomyWriter = taxonomyAccessor.getTaxonomyWriter();
}
} else {
log.error("IndexLocation is not created for Lucene. " + "Using the " + CRLuceneIndexJob.class.getName()
+ " requires that you use the " + LuceneIndexLocation.class.getName()
+ ". You can configure another Job by setting the " + IndexLocation.UPDATEJOBCLASS_KEY + " key in your config.");
throw new CRException(new CRError("Error", "IndexLocation is not created for Lucene."));
}
log.debug("Using rule: " + rule);
// prepare the map of indexed/stored attributes
Map<String, Boolean> attributes = new HashMap<String, Boolean>();
List<String> containedAttributes = IndexerUtil.getListFromString(config.getString(CONTAINED_ATTRIBUTES_KEY), ",");