private void deleteProductFromIndex(String productId) throws IOException, SolrServerException { server.deleteById(productId); }
private void deleteProductFromIndex(String productId) throws IOException, SolrServerException { server.deleteById(productId); }
@Override public void remove(Long id) { try { solrServer.deleteById(String.valueOf(id)); } catch (SolrServerException | IOException e) { throw new NonTransientDataAccessResourceException("Error removing org from SOLR Server", e); } }
@Override public synchronized void delete(final Collection<String> ids) { checkSession(); try { LOG.debug("Deleting documents with ids: {} using sessionId: {}", ids, sessionId); if (!ids.isEmpty()) { solrUpdateServer.deleteById(new ArrayList<String>(ids)); } } catch (final SolrServerException e) { final String msg = "Delete documents failed (Solr Server Error response): "; LOG.warn(msg, e); throw new GeneralServiceException(e, msg); } catch (final IOException e) { final String msg = "Delete documents failed: "; LOG.warn(msg, e); throw new GeneralServiceException(e, msg); } }
private void delete(LocalDocument doc) throws SolrServerException, IOException, RequiredArgumentMissingException { if(!doc.hasContentField(idField)) { throw new RequiredArgumentMissingException("Document has no ID field"); } if (getCommitWithin() != 0) { solr.deleteById(doc.getContentField(idField).toString(), getCommitWithin()); } else { solr.deleteById(doc.getContentField(idField).toString()); } }
private void delete(LocalDocument doc) throws SolrServerException, IOException, RequiredArgumentMissingException { if(!doc.hasContentField(idField)) { throw new RequiredArgumentMissingException("Document has no ID field"); } if (getCommitWithin() != 0) { solr.deleteById(doc.getContentField(idField).toString(), getCommitWithin()); } else { solr.deleteById(doc.getContentField(idField).toString()); } }
@Override public void deleteById(List<String> idList, String ldProgramName) throws StoreException { SolrServer solrServer = SolrCoreManager.getInstance(bundleContext, managedSolrServer).getServer( ldProgramName); for (int i = 0; i < idList.size(); i++) { String id = idList.get(i); idList.remove(i); idList.add(i, id); } try { solrServer.deleteById(idList); solrServer.commit(); } catch (SolrServerException e) { log.error("Solr Server Exception", e); throw new StoreException(e.getMessage(), e); } catch (IOException e) { log.error("IOException", e); throw new StoreException(e.getMessage(), e); } }
/** * Remove an entity that is existing in the index. */ public void remove(String id) throws IndexServiceException { try { solr.server().deleteById(id); } catch (SolrServerException e) { throw new IndexServiceException(e); } catch (IOException e) { throw new IndexServiceException(e); } }
@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); } }
@Override public int commit() { try { synchronized (this) { Collection<SolrInputDocument> docs = getAddedDocs().values(); if (!docs.isEmpty()) { solrServer.add(docs); } List<String> ids = getDeletedDocs(); if (!ids.isEmpty()) { solrServer.deleteById(ids); } solrServer.commit(); } clear(); return TwoPhaseOutcome.FINISH_OK; } catch (Exception eee) { log.error("Error commit solr", eee); return TwoPhaseOutcome.FINISH_ERROR; } }
@Override @Async public void removeComplexConcept(SplitNonPreferredTerm complexConcept) throws TechnicalException { try { solrServer.deleteById(complexConcept.getIdentifier()); solrServer.commit(); } catch (SolrServerException e) { throw new TechnicalException( "Error executing query for removing complex concept from index!", e); } catch (IOException e) { throw new TechnicalException( "IO error during executing query for removing complex concept from index!", e); } } }
@Override @Async public void removeTerm(ThesaurusTerm thesaurusTerm) throws TechnicalException { try { solrServer.deleteById(thesaurusTerm.getIdentifier()); solrServer.commit(); } catch (SolrServerException e) { throw new TechnicalException( "Error executing query for removing Term from index!", e); } catch (IOException e) { throw new TechnicalException( "IO error during executing query for removing Term from index!", e); } }
@Override @Async public void removeConcept(ThesaurusConcept thesaurusConcept) throws TechnicalException { try { solrServer.deleteById(thesaurusConcept.getIdentifier()); solrServer.commit(); } catch (SolrServerException e) { throw new TechnicalException( "Error executing query for removing Concept from index!", e); } catch (IOException e) { throw new TechnicalException( "IO error during executing query for removing Concept from index!", e); } } }
@Override public void deleteById(String id, String ldProgramName) throws StoreException { if (id == null || id.isEmpty()) return; SolrServer solrServer = SolrCoreManager.getInstance(bundleContext, managedSolrServer).getServer( ldProgramName); removeEnhancements(id); try { solrServer.deleteById(id); solrServer.commit(); } catch (SolrServerException e) { log.error("Solr Server Exception", e); throw new StoreException(e.getMessage(), e); } catch (IOException e) { log.error("IOException", e); throw new StoreException(e.getMessage(), e); } }
@Override @Async public void removeNote(Note note) throws TechnicalException { try { solrServer.deleteById(note.getIdentifier()); solrServer.commit(); } catch (SolrServerException e) { throw new TechnicalException( "Error executing query for removing Concept from index!", e); } catch (IOException e) { throw new TechnicalException( "IO error during executing query for removing Concept from index!", e); } } }
@Override public int commit() { try { synchronized (this) { Collection<SolrInputDocument> docs = getAddedDocs().values(); if (!docs.isEmpty()) { addAllSolrfield(docs); solrServer.add(docs); } List<String> ids = getDeletedDocs(); if (!ids.isEmpty()) { solrServer.deleteById(ids); } solrServer.commit(); } clear(); return TwoPhaseOutcome.FINISH_OK; } catch (Exception eee) { log.error("Error commit solr", eee); return TwoPhaseOutcome.FINISH_ERROR; } }
if (delete) { server .deleteById(metadata.getMetadata("CAS." + CoreMetKeys.PRODUCT_ID));
/** * unIndex removes an Item, Collection, or Community * * @param context The relevant DSpace Context. * @param dso DSpace Object, can be Community, Item, or Collection * @param commit if <code>true</code> force an immediate commit on SOLR * @throws SQLException if database error * @throws IOException if IO error */ @Override public void unIndexContent(Context context, DSpaceObject dso, boolean commit) throws SQLException, IOException { try { if (dso == null) { return; } String uniqueID = dso.getType() + "-" + dso.getID(); getSolr().deleteById(uniqueID); if (commit) { getSolr().commit(); } } catch (Exception exception) { log.error(exception.getMessage(), exception); emailException(exception); } }
/** * Remove an id from the index. * * @param row * @throws AvroBaseException */ public void unindex(K row) throws AvroBaseException { if (solrServer == null) { return; } // TODO: do we really want to throw an exception on index failure?? try { solrServer.deleteById(keyTx.apply(row)); solrServer.commit(); } catch (SolrServerException e) { throw new AvroBaseException(e); } catch (IOException e) { throw new AvroBaseException(e); } }
if (delete) { server .deleteById(metadata.getMetadata("CAS." + CoreMetKeys.PRODUCT_ID));