if (propertiesChanged || !before.exists()) {
updateCallback.indexUpdate();
try {
solrServer.add(docFromState(after));
} catch (SolrServerException e) {
throw new CommitFailedException(
"Solr", 2, "Failed to add a document to Solr", e);
} catch (IOException e) {
throw new CommitFailedException(
"Solr", 6, "Failed to send data to Solr", e);
}
}
if (parent == null) {
try {
OakSolrUtils.commitByPolicy(
solrServer, configuration.getCommitPolicy());
} catch (SolrServerException e) {
throw new CommitFailedException(
"Solr", 3, "Failed to commit changes to Solr", e);
} catch (IOException e) {
throw new CommitFailedException(
"Solr", 6, "Failed to send data to Solr", e);
}
}
}