@Override public void commit() { try { getSolr().commit(); } catch (SolrServerException e) { log.error("Error while committing authority solr server", e); } catch (IOException e) { log.error("Error while committing authority solr server", e); } }
private void batchUpdateStats() throws SolrServerException, IOException { if (docs.size() > 0) { server.add(docs); server.commit(true, true); docs.clear(); } }
public void commit() throws Exception { server.commit(); }
public void insertOneDoc() throws SolrServerException, IOException { HttpSolrServer solr = new HttpSolrServer(solrIndexPath); SolrInputDocument doc = new SolrInputDocument(); doc.addField("fieldName", "fieldValue"); solr.add(doc); solr.commit(); }
private void commitSolr(boolean optimize) throws IntactSolrException { try { if (optimize) { solrServer.optimize(); } else { solrServer.commit(); } } catch (Exception e) { int numberOfTries = 1; boolean isSuccessful = false; while (numberOfTries <= this.numberOfTries && !isSuccessful){ try { if (optimize) { solrServer.optimize(); } else { solrServer.commit(); } isSuccessful = true; } catch (Exception e2) { numberOfTries++; } } if (!isSuccessful){ throw new IntactSolrException("Problem during commit", e); } } }
/** * Remove all documents from the Solr index with the given URL, then commit and optimise the index. * * @param solrUrl URL of the Solr core to clear. * @throws IOException if there is a problem in communicating with Solr. * @throws SolrServerException if there is a problem in communicating with Solr. */ public static void clearIndex(String solrUrl) throws IOException, SolrServerException { HttpSolrServer solr = new HttpSolrServer(solrUrl); solr.deleteByQuery("*:*"); solr.commit(); solr.optimize(); }
server.commit(); server.shutdown();
statisticsYearServer.commit(true, true);
solr.commit(true, true);
solr.commit(); } catch (SolrServerException sse) { System.err.println("Error committing statistics to solr server!");
solr.commit();