Revision 8035
Added by Jing Tao over 11 years ago
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/IndexGenerator.java | ||
---|---|---|
685 | 685 |
/* |
686 | 686 |
* Remove the solr index for the list of ids |
687 | 687 |
*/ |
688 |
private void removeIndex(List<String> ids) throws ServiceFailure, XPathExpressionException, NotImplemented, NotFound, UnsupportedType, IOException, SolrServerException, SAXException, ParserConfigurationException, OREParserException {
|
|
688 |
private void removeIndex(List<String> ids) { |
|
689 | 689 |
if(ids!= null) { |
690 | 690 |
for(String id :ids) { |
691 |
removeIndex(id); |
|
691 |
try { |
|
692 |
removeIndex(id); |
|
693 |
} catch (Exception e) { |
|
694 |
IndexEvent event = new IndexEvent(); |
|
695 |
Identifier pid = new Identifier(); |
|
696 |
pid.setValue(id); |
|
697 |
event.setIdentifier(pid); |
|
698 |
event.setDate(Calendar.getInstance().getTime()); |
|
699 |
event.setAction(Event.DELETE); |
|
700 |
String error = "IndexGenerator.index - Metacat Index couldn't remove the index for the id - "+id+" because "+e.getMessage(); |
|
701 |
event.setDescription(error); |
|
702 |
try { |
|
703 |
EventlogFactory.createIndexEventLog().write(event); |
|
704 |
} catch (Exception ee) { |
|
705 |
log.error("SolrIndex.insertToIndex - IndexEventLog can't log the index deleting event :"+ee.getMessage()); |
|
706 |
} |
|
707 |
log.error(error); |
|
708 |
} |
|
709 |
|
|
692 | 710 |
} |
693 | 711 |
} |
694 | 712 |
} |
Also available in: Unified diff
The exceptions will be caught during the looping of deleting the solr index.