public Object run() throws IOException, SolrServerException { update.process(server); if (immediateCommit) { server.commit(); } return null; // nothing to return } });
/** * This method commits all of the modifications to the Solr index. */ public void commit() throws SolrServerException, IOException { server.commit(); }
public Object run() throws IOException, SolrServerException { update.process(server); if (immediateCommit) { server.commit(); } return null; } });
public Object run() throws IOException, SolrServerException { update.process(server); if (immediateCommit) { server.commit(); } return null; // nothing to return } });
/** waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access * @throws IOException */ public UpdateResponse commit( ) throws SolrServerException, IOException { return commit(true, true); }
@Override public void removeIndex(String query) throws IOException, SolrServerException { solr.deleteByQuery(query); solr.commit(); }
public Object run() throws IOException, SolrServerException { server.add(inputDoc); if(commit){ server.commit(); } return null; } });
//Delete particular column using Solr SolrServer solrServer; solrServer = new HttpSolrServer(url); solrServer.deleteByQuery("columnName:value"); solrServer.commit();
private void clearIndex() throws DSpaceSolrIndexerException { try { System.out.println("Clearing index"); solrServerResolver.getServer().deleteByQuery("*:*"); solrServerResolver.getServer().commit(); System.out.println("Index cleared"); } catch (SolrServerException | IOException ex) { throw new DSpaceSolrIndexerException(ex.getMessage(), ex); } }
@Override public void commit() throws SearchServiceException { try { if (getSolr() != null) { getSolr().commit(); } } catch (Exception e) { throw new SearchServiceException(e.getMessage(), e); } }
@Override public void removeAllConcepts() throws ClassifierException { SolrServer solrServer = getActiveSolrServer(); try { solrServer.deleteByQuery("*:*"); solrServer.commit(); } catch (Exception e) { String msg = String.format("Error deleting concepts from Solr Core '%s'", solrCoreId); throw new ClassifierException(msg, e); } }
@Override public void persist(OrgDisambiguatedSolrDocument orgDisambiguatedSolrDocument) { try { solrServer.addBean(orgDisambiguatedSolrDocument); solrServer.commit(); } catch (SolrServerException se) { throw new NonTransientDataAccessResourceException("Error persisting org to SOLR Server", se); } catch (IOException ioe) { throw new NonTransientDataAccessResourceException("IOException when persisting org to SOLR", ioe); } }
public void close() throws IndexServiceException { try { solr.server().commit(); } catch (SolrServerException e) { throw new IndexServiceException(e); } catch (IOException e) { throw new IndexServiceException(e); } }
@Override public void persist(OrcidSolrDocument orcidSolrDocument) { try { solrServer.addBean(orcidSolrDocument); solrServer.commit(); } catch (SolrServerException se) { throw new NonTransientDataAccessResourceException("Error persisting to SOLR Server", se); } catch (IOException ioe) { throw new NonTransientDataAccessResourceException("IOException when persisting to SOLR", ioe); } }
@Override public void removeOrcids(List<String> orcids) { try { solrServer.deleteById(orcids); solrServer.commit(); } catch (SolrServerException se) { throw new NonTransientDataAccessResourceException("Error deleting orcids from SOLR Server", se); } catch (IOException ioe) { throw new NonTransientDataAccessResourceException("Error deleting orcids from SOLR Server", ioe); } }
public void clear() throws IndexServiceException { try { solr.server().deleteByQuery("*:*"); solr.server().commit(); } catch (SolrServerException e) { throw new IndexServiceException(e); } catch (IOException e) { throw new IndexServiceException(e); } }
protected void commitTerms(Collection<SolrInputDocument> batch) throws SolrServerException, IOException, OutOfMemoryError { this.externalServicesAccess.getServer().add(batch); this.externalServicesAccess.getServer().commit(); this.externalServicesAccess.getCache().removeAll(); }
String urlString = "http://localhost:8983/solr"; SolrServer solr = new HttpSolrServer(urlString); SolrInputDocument document = new SolrInputDocument(); document.addField("id", "552199"); document.addField("name", "Gouda cheese wheel"); document.addField("price", "49.99"); UpdateResponse response = solr.add(document); // Remember to commit your changes! solr.commit();
/** * Delete all the documents */ public void clear() throws SolrServerException, IOException { this.getServer().deleteByQuery("*:*"); this.getServer().commit(); }
/** * Delete all the documents */ public void clear() throws SolrServerException, IOException { this.getServer().deleteByQuery("*:*"); this.getServer().commit(); }