updateRequest.setDocumentFilter(getFilterFor(mrepository.getRepositoryPolicy()));
}
try {
IndexUpdateResult result = indexUpdater.fetchAndUpdateIndex(updateRequest);
//Check if successful
if (!result.isSuccessful()) {
//This condition occurs when we have requested an incremental-only update,
//but it could not be completed. In this case, we need to request a full update
//This needs to be communicated upstream so that the proper locking can take place
throw new IncrementalIndexUpdateException("Cannot incrementally update index. Request a full update");
}
boolean hasRemoteIndexUpdate = result.getTimestamp() != null;
if (hasRemoteIndexUpdate) {
log.info(RepositoryStringUtils.getFormattedMessage(
"Remote indexes updated successfully for repository %s", repository));
}