Search in sources :

Example 1 with Action

use of cz.mzk.recordmanager.server.solr.SolrIndexingExceptionHandler.Action in project RecordManager2 by moravianlibrary.

the class SolrServerFacadeImpl method fallbackIndex.

private void fallbackIndex(Collection<SolrInputDocument> documents, int commitWithinMs) throws SolrServerException {
    for (SolrInputDocument document : documents) {
        boolean carryOn = true;
        while (carryOn) {
            try {
                server.add(document, commitWithinMs);
                exceptionHandler.ok();
                carryOn = false;
            } catch (SolrException | SolrServerException | IOException ex) {
                Action action = exceptionHandler.handle(ex, documents);
                carryOn = action == Action.RETRY;
            }
        }
    }
}
Also used : SolrInputDocument(org.apache.solr.common.SolrInputDocument) Action(cz.mzk.recordmanager.server.solr.SolrIndexingExceptionHandler.Action) SolrServerException(org.apache.solr.client.solrj.SolrServerException) IOException(java.io.IOException) SolrException(org.apache.solr.common.SolrException)

Aggregations

Action (cz.mzk.recordmanager.server.solr.SolrIndexingExceptionHandler.Action)1 IOException (java.io.IOException)1 SolrServerException (org.apache.solr.client.solrj.SolrServerException)1 SolrException (org.apache.solr.common.SolrException)1 SolrInputDocument (org.apache.solr.common.SolrInputDocument)1