Index: metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexIT.java
===================================================================
--- metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexIT.java	(revision 8342)
+++ metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexIT.java	(revision 8343)
@@ -23,6 +23,7 @@
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.response.XMLResponseWriter;
 import org.apache.solr.servlet.SolrRequestParsers;
+import org.dataone.service.types.v1.Identifier;
 import org.dataone.service.types.v1.SystemMetadata;
 import org.dataone.service.util.TypeMarshaller;
 import org.junit.Before;
@@ -70,7 +71,9 @@
        SystemMetadata systemMetadata = TypeMarshaller.unmarshalTypeFromFile(SystemMetadata.class, SYSTEMMETAFILEPATH);
        InputStream emlInputStream = new FileInputStream(new File(EMLFILEPATH)); 
        //List<String> chain = null;
-       solrIndex.update(id, systemMetadata, emlInputStream);
+       Identifier pid = new Identifier();
+       pid.setValue(id);
+       solrIndex.update(pid, systemMetadata, emlInputStream);
        String result = doQuery(solrIndex.getSolrServer());
        List<String> ids = solrIndex.getSolrIds();
        //assertTrue(ids.size() == 1);
@@ -95,8 +98,11 @@
        InputStream emlInputStream = new FileInputStream(new File(EMLUPDATEFILEPATH));  
        /*obsoletes.add(id);
        obsoletes.add("tao");*/
-       solrIndex.update(newId, systemMetadata, emlInputStream);
+       Identifier pid = new Identifier();
+       pid.setValue(newId);
+       solrIndex.update(pid, systemMetadata, emlInputStream);
        String result = doQuery(solrIndex.getSolrServer());
+       assertTrue(result.contains("version1"));
        assertTrue(result.contains("version2"));
     }
     
@@ -113,10 +119,12 @@
        /*ArrayList<String> obsoletes = new ArrayList<String>();
        obsoletes.add(id);
        obsoletes.add("tao");*/
-       solrIndex.update(newId, systemMetadata, emlInputStream);
+       Identifier pid = new Identifier();
+       pid.setValue(newId);
+       solrIndex.update(pid, systemMetadata, emlInputStream);
        String result = doQuery(solrIndex.getSolrServer());
        assertTrue(result.contains("version1"));
-       assertTrue(result.contains("version2"));
+       assertTrue(!result.contains("version2"));
     }
     
     
Index: metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SolrIndex.java
===================================================================
--- metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SolrIndex.java	(revision 8342)
+++ metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SolrIndex.java	(revision 8343)
@@ -19,6 +19,7 @@
 package edu.ucsb.nceas.metacat.index;
 
 import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -55,6 +56,7 @@
 import org.dataone.cn.indexer.parser.SolrField;
 import org.dataone.cn.indexer.resourcemap.ResourceEntry;
 import org.dataone.cn.indexer.resourcemap.ResourceMap;
+import org.dataone.cn.indexer.resourcemap.ResourceMapFactory;
 import org.dataone.cn.indexer.solrhttp.SolrDoc;
 import org.dataone.cn.indexer.solrhttp.SolrElementField;
 import org.dataone.service.exceptions.NotFound;
@@ -320,15 +322,15 @@
      * @param data
      * @throws SolrServerException
      */
-    private void checkParams(String pid, SystemMetadata systemMetadata, InputStream data) throws SolrServerException {
-        if(pid == null || pid.trim().equals("")) {
+    private void checkParams(Identifier pid, SystemMetadata systemMetadata, InputStream data) throws SolrServerException {
+        if(pid == null || pid.getValue() == null || pid.getValue().trim().equals("")) {
             throw new SolrServerException("The identifier of the indexed document should not be null or blank.");
         }
         if(systemMetadata == null) {
-            throw new SolrServerException("The system metadata of the indexed document should not be null.");
+            throw new SolrServerException("The system metadata of the indexed document "+pid.getValue()+ " should not be null.");
         }
         if(data == null) {
-            throw new SolrServerException("The indexed document itself should not be null.");
+            throw new SolrServerException("The indexed document itself for pid "+pid.getValue()+" should not be null.");
         }
     }
     
@@ -344,11 +346,11 @@
      * @throws NotFound 
      * @throws NotImplemented 
      */
-    private synchronized void insert(String pid, SystemMetadata systemMetadata, InputStream data) 
+    private synchronized void insert(Identifier pid, SystemMetadata systemMetadata, InputStream data) 
                     throws IOException, SAXException, ParserConfigurationException,
                     XPathExpressionException, SolrServerException, JiBXException, EncoderException, NotImplemented, NotFound, UnsupportedType {
         checkParams(pid, systemMetadata, data);
-        Map<String, SolrDoc> docs = process(pid, systemMetadata, data);
+        Map<String, SolrDoc> docs = process(pid.getValue(), systemMetadata, data);
         
         //transform the Map to the SolrInputDocument which can be used by the solr server
         if(docs != null) {
@@ -426,34 +428,64 @@
     
     /**
      * Update the solr index. This method handles the three scenarios:
-     * 1. Update an existing doc - if the the system metadata shows the value of the archive is false and it has an obsoletes,
+     * 1. Remove an existing doc - if the the system metadata shows the value of the archive is true,
      *    remove the index for the previous version(s) and generate new index for the doc.
-     * 2. Add a new doc - if the system metadata shows the value of the archive is false and it hasn't an obsoletes, generate the
+     * 2. Add a new doc - if the system metadata shows the value of the archive is false, generate the
      *    index for the doc.
-     * @param pid  the id of the document
-     * @param obsoleteIds  the chain of the obsoletes by this id
-     * @param systemMetadata  the system metadata associated with the data object
-     * @param data  the data object itself
-     * @throws SolrServerException 
-     * @throws JiBXException 
-     * @throws EncoderException 
-     * @throws UnsupportedType 
-     * @throws NotFound 
-     * @throws NotImplemented 
-     * @throws ServiceFailure 
-     * @throws OREParserException 
      */
-    public void update(String pid, SystemMetadata systemMetadata, InputStream data) 
-                    throws IOException, SAXException, ParserConfigurationException,
-                    XPathExpressionException, SolrServerException, JiBXException, EncoderException, NotImplemented, NotFound, UnsupportedType, ServiceFailure, OREParserException {
-        checkParams(pid, systemMetadata, data);
-        //generate index for either add or update.
-        insert(pid, systemMetadata, data);
-        log.info("============================= update index for the identifier "+pid);
-       
+    public void update(Identifier pid, SystemMetadata systemMetadata) {
+        String objectPath = null;
+        InputStream data = null;
+        try {
+            objectPath = DistributedMapsFactory.getObjectPathMap().get(pid);
+            data = new FileInputStream(objectPath);
+            update(pid, systemMetadata, data);
+            EventlogFactory.createIndexEventLog().remove(pid);
+        } catch (Exception e) {
+            String error = "SolrIndex.update - could not update the solr index since " + e.getMessage();
+            writeEventLog(systemMetadata, pid, error);
+            log.error(error, e);
+        }
     }
     
     
+    /**
+     * Update the solr index. This method handles the three scenarios:
+     * 1. Remove an existing doc - if the the system metadata shows the value of the archive is true,
+     *    remove the index for the previous version(s) and generate new index for the doc.
+     * 2. Add a new doc - if the system metadata shows the value of the archive is false, generate the
+     *    index for the doc.
+     * @param pid
+     * @param systemMetadata
+     * @param data
+     * @throws SolrServerException
+     * @throws ServiceFailure
+     * @throws XPathExpressionException
+     * @throws NotImplemented
+     * @throws NotFound
+     * @throws UnsupportedType
+     * @throws IOException
+     * @throws SAXException
+     * @throws ParserConfigurationException
+     * @throws OREParserException
+     * @throws JiBXException
+     * @throws EncoderException
+     */
+    void update(Identifier pid, SystemMetadata systemMetadata, InputStream data) throws SolrServerException, 
+                                ServiceFailure, XPathExpressionException, NotImplemented, NotFound, UnsupportedType, 
+                                IOException, SAXException, ParserConfigurationException, OREParserException, JiBXException, EncoderException {
+        checkParams(pid, systemMetadata, data);
+        boolean isArchive = systemMetadata.getArchived();
+        if(isArchive ) {
+            //delete the index for the archived objects
+            remove(pid.getValue(), systemMetadata);
+            log.info("SolrIndex.update============================= archive the idex for the identifier "+pid);
+        } else {
+            //generate index for either add or update.
+            insert(pid, systemMetadata, data);
+            log.info("SolrIndex.update============================= insert index for the identifier "+pid);
+        }
+    }
     
    
 
@@ -460,9 +492,9 @@
     /*
      * Is the pid a resource map
      */
-    private boolean isDataPackage(String pid) throws FileNotFoundException, ServiceFailure {
+    private boolean isDataPackage(String pid, SystemMetadata sysmeta) throws FileNotFoundException, ServiceFailure {
         boolean isDataPackage = false;
-        SystemMetadata sysmeta = DistributedMapsFactory.getSystemMetadata(pid);
+        //SystemMetadata sysmeta = DistributedMapsFactory.getSystemMetadata(pid);
         if(sysmeta != null) {
             isDataPackage = IndexGenerator.isResourceMap(sysmeta.getFormatId());
         }
@@ -479,7 +511,155 @@
             return false;
         }
     }
+    /**
+     * Remove the indexed associated with specified pid.
+     * @param pid  the pid which the indexes are associated with
+     * @throws IOException
+     * @throws SolrServerException
+     * @throws ParserConfigurationException 
+     * @throws SAXException 
+     * @throws UnsupportedType 
+     * @throws NotFound 
+     * @throws NotImplemented 
+     * @throws XPathExpressionException 
+     * @throws ServiceFailure 
+     * @throws OREParserException 
+     */
+    private void remove(String pid, SystemMetadata sysmeta) throws IOException, SolrServerException, ServiceFailure, XPathExpressionException, NotImplemented, NotFound, UnsupportedType, SAXException, ParserConfigurationException, OREParserException {
+        if (isDataPackage(pid, sysmeta)) {
+            removeDataPackage(pid);
+        } else if (isPartOfDataPackage(pid)) {
+            removeFromDataPackage(pid);
+        } else {
+            removeFromIndex(pid);
+        }
+    }
+    
+    /*
+     * Remove a resource map pid
+     */
+    private void removeDataPackage(String pid) throws ServiceFailure, SAXException, XPathExpressionException, NotImplemented, NotFound, UnsupportedType, SolrServerException, IOException, ParserConfigurationException, OREParserException  {
+        Document resourceMapDoc = generateXmlDocument(DistributedMapsFactory.getDataObject(pid));
+        //ResourceMap resourceMap = new ResourceMap(resourceMapDoc);
+        ResourceMap resourceMap = ResourceMapFactory.buildResourceMap(resourceMapDoc);
+        List<String> documentIds = resourceMap.getAllDocumentIDs();
+        List<SolrDoc> indexDocuments =ResourceMapSubprocessor.getSolrDocs(documentIds);
+        removeFromIndex(pid);
+        //List<SolrDoc> docsToUpdate = new ArrayList<SolrDoc>();
+        // for each document in data package:
+        for (SolrDoc indexDoc : indexDocuments) {
 
+            if (indexDoc.getIdentifier().equals(pid)) {
+                continue; // skipping the resource map, no need update
+                          // it.
+                          // will
+                          // be removed.
+            }
+
+            // Remove resourceMap reference
+            indexDoc.removeFieldsWithValue(SolrElementField.FIELD_RESOURCEMAP,
+                    resourceMap.getIdentifier());
+
+            // // Remove documents/documentedby values for this resource
+            // map
+            for (ResourceEntry entry : resourceMap.getMappedReferences()) {
+                if (indexDoc.getIdentifier().equals(entry.getIdentifier())) {
+                    for (String documentedBy : entry.getDocumentedBy()) {
+                        // Using removeOneFieldWithValue in-case same
+                        // documents
+                        // are in more than one data package. just
+                        // remove
+                        // one
+                        // instance of data package info.
+                        indexDoc.removeOneFieldWithValue(SolrElementField.FIELD_ISDOCUMENTEDBY,
+                                documentedBy);
+                    }
+                    for (String documents : entry.getDocuments()) {
+                        indexDoc.removeOneFieldWithValue(SolrElementField.FIELD_DOCUMENTS,
+                                documents);
+                    }
+                    break;
+                }
+            }
+            removeFromIndex(indexDoc.getIdentifier());
+            insertToIndex(indexDoc);
+            //docsToUpdate.add(indexDoc);
+        }
+        //SolrElementAdd addCommand = new SolrElementAdd(docsToUpdate);
+        //httpService.sendUpdate(solrIndexUri, addCommand);
+    }
+
+    private void removeFromDataPackage(String pid) throws XPathExpressionException, NotImplemented, NotFound, UnsupportedType, SolrServerException, IOException, ParserConfigurationException, SAXException  {
+        SolrDoc indexedDoc = ResourceMapSubprocessor.getSolrDoc(pid);
+        removeFromIndex(pid);
+        List<SolrDoc> docsToUpdate = new ArrayList<SolrDoc>();
+
+        List<String> documents = indexedDoc.getAllFieldValues(SolrElementField.FIELD_DOCUMENTS);
+        for (String documentsValue : documents) {
+            SolrDoc solrDoc = ResourceMapSubprocessor.getSolrDoc(documentsValue);
+            solrDoc.removeFieldsWithValue(SolrElementField.FIELD_ISDOCUMENTEDBY, pid);
+            removeFromIndex(documentsValue);
+            insertToIndex(solrDoc);
+        }
+
+        List<String> documentedBy = indexedDoc
+                .getAllFieldValues(SolrElementField.FIELD_ISDOCUMENTEDBY);
+        for (String documentedByValue : documentedBy) {
+            SolrDoc solrDoc = ResourceMapSubprocessor.getSolrDoc(documentedByValue);
+            solrDoc.removeFieldsWithValue(SolrElementField.FIELD_DOCUMENTS, documentedByValue);
+            //docsToUpdate.add(solrDoc);
+            removeFromIndex(documentedByValue);
+            insertToIndex(solrDoc);
+        }
+
+        //SolrElementAdd addCommand = new SolrElementAdd(docsToUpdate);
+        //httpService.sendUpdate(solrIndexUri, addCommand);
+    }
+
+    /*
+     * Remove a pid from the solr index
+     */
+    private void removeFromIndex(String pid) throws SolrServerException, IOException {
+        if(pid != null && !pid.trim().equals("")) {
+            /*IndexEvent event = new IndexEvent();
+            event.setDate(Calendar.getInstance().getTime());
+            Identifier identifier = new Identifier();
+            identifier.setValue(pid);
+            event.setIdentifier(identifier);*/
+            try {
+                solrServer.deleteById(pid);
+                solrServer.commit();
+                /*event.setType(IndexEvent.SUCCESSDELETE);
+                event.setDescription("Successfully remove the solr index for the id "+identifier.getValue());
+                try {
+                    EventlogFactory.createIndexEventLog().write(event);
+                } catch (Exception e) {
+                    log.error("SolrIndex.removeFromIndex - IndexEventLog can't log the index deleting event :"+e.getMessage());
+                }*/
+            } catch (SolrServerException e) {
+                /*event.setAction(Event.DELETE);
+                event.setDescription("Failurely remove the solr index for the id "+identifier.getValue()+" since "+e.getMessage());
+                try {
+                    EventlogFactory.createIndexEventLog().write(event);
+                } catch (Exception ee) {
+                    log.error("SolrIndex.removeFromIndex - IndexEventLog can't log the index deleting event :"+ee.getMessage());
+                }*/
+                throw e;
+                
+            } catch (IOException e) {
+                /*event.setAction(Event.DELETE);
+                event.setDescription("Failurely remove the solr index for the id "+identifier.getValue()+" since "+e.getMessage());
+                try {
+                    EventlogFactory.createIndexEventLog().write(event);
+                } catch (Exception ee) {
+                    log.error("SolrIndex.removeFromIndex - IndexEventLog can't log the index deleting event :"+ee.getMessage());
+                }*/
+                throw e;
+            }
+            
+        }
+    }
+
     /**
      * Get the solrServer
      * @return
@@ -517,4 +697,28 @@
         }
         return list;
     }
+    
+    private void writeEventLog(SystemMetadata systemMetadata, Identifier pid, String error) {
+        IndexEvent event = new IndexEvent();
+        event.setIdentifier(pid);
+        event.setDate(Calendar.getInstance().getTime());
+        String action = null;
+        if (systemMetadata == null ) {
+            action = Event.CREATE.xmlValue();
+            event.setAction(Event.CREATE);
+        }
+        else if(systemMetadata.getArchived()) {
+            action = Event.DELETE.xmlValue();
+            event.setAction(Event.DELETE);
+        } else {
+            action = Event.CREATE.xmlValue();
+            event.setAction(Event.CREATE);
+        }
+        event.setDescription("Failed to "+action+"the solr index for the id "+pid.getValue()+" since "+error);
+        try {
+            EventlogFactory.createIndexEventLog().write(event);
+        } catch (Exception ee) {
+            log.error("SolrIndex.insertToIndex - IndexEventLog can't log the index inserting event :"+ee.getMessage());
+        }
+    }
 }
Index: metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SystemMetadataEventListener.java
===================================================================
--- metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SystemMetadataEventListener.java	(revision 8342)
+++ metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SystemMetadataEventListener.java	(revision 8343)
@@ -149,15 +149,17 @@
 		//System.out.println("===================================update the document "+pid.getValue());
 		log.info("===================================adding the document "+pid.getValue());
 		SystemMetadata systemMetadata = entryEvent.getItem();
-		if(systemMetadata == null) {
+		
+		/*if(systemMetadata == null) {
 		    writeEventLog(systemMetadata, pid, "SystemMetadataEventListener.itemAdded -could not get the SystemMetadata");
 		    return;
-		}
+		}*/
 		
 		// make sure we remove this object so that it can be re-added in the future
-		if (source != null) {
+		if (source != null && systemMetadata != null) {
 			source.remove(systemMetadata);
 		}
+		solrIndex.update(pid, systemMetadata);
 				
 		//Identifier obsoletes = systemMetadata.getObsoletes();
 		//List<String> obsoletesChain = null;
@@ -171,52 +173,22 @@
 	            return;
 			}
 		}*/
-		String objectPath = null;
-		try {
-			objectPath = DistributedMapsFactory.getObjectPathMap().get(pid);
-		} catch (Exception e) {
-		    String error = "SystemMetadataEventListener.itemAdded - could not look up object path" + e.getMessage();
-		    writeEventLog(systemMetadata, pid, error);
-			log.error(error, e);
-			return;
-		}
-		if(objectPath != null) {
+		
+		/*if(objectPath != null) {
 		    InputStream data = null;
 	        try {
 	            data = new FileInputStream(objectPath);
 	            solrIndex.update(pid.getValue(), systemMetadata, data);
-                EventlogFactory.createIndexEventLog().remove(pid);
+	            EventlogFactory.createIndexEventLog().remove(pid);
 	        } catch (Exception e) {
 	            String error = "SystemMetadataEventListener.itemAdded - could not comit the index into the solr server since " + e.getMessage();
 	            writeEventLog(systemMetadata, pid, error);
 	            log.error(error, e);
 	        }
-		}
+		}*/
 		
 	}
 	
-	private void writeEventLog(SystemMetadata systemMetadata, Identifier pid, String error) {
-	    IndexEvent event = new IndexEvent();
-        event.setIdentifier(pid);
-	    event.setDate(Calendar.getInstance().getTime());
-	    String action = null;
-	    if (systemMetadata == null ) {
-	        action = Event.CREATE.xmlValue();
-            event.setAction(Event.CREATE);
-	    }
-	    else if(systemMetadata.getArchived() || systemMetadata.getObsoletedBy() != null) {
-            action = Event.UPDATE.xmlValue();
-            event.setAction(Event.UPDATE);
-        } else {
-            action = Event.CREATE.xmlValue();
-            event.setAction(Event.CREATE);
-        }
-        event.setDescription("Failed to "+action+"the solr index for the id "+pid.getValue()+" since "+error);
-        try {
-            EventlogFactory.createIndexEventLog().write(event);
-        } catch (Exception ee) {
-            log.error("SolrIndex.insertToIndex - IndexEventLog can't log the index inserting event :"+ee.getMessage());
-        }
-	}
+	
     
 }
Index: metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/IndexGenerator.java
===================================================================
--- metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/IndexGenerator.java	(revision 8342)
+++ metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/IndexGenerator.java	(revision 8343)
@@ -108,24 +108,7 @@
       
     }
     
-    /**
-     * Build the index for all documents in Metacat without overwriting.
-     * @throws SolrServerException 
-     * @throws ServiceFailure 
-     * @throws NotImplemented 
-     * @throws NotAuthorized 
-     * @throws InvalidToken 
-     * @throws InvalidRequest 
-     * @throws IndexEventLogException 
-     * @throws IllegalAccessException 
-     * @throws InstantiationException 
-     * @throws ClassNotFoundException 
-     */
-    /*public void indexAll() throws InvalidRequest, InvalidToken, NotAuthorized, 
-                            NotImplemented, ServiceFailure, SolrServerException, FileNotFoundException, ClassNotFoundException, InstantiationException, IllegalAccessException, IndexEventLogException {
-        boolean force = false;
-        indexAll(force);
-    }*/
+   
     
     /**
      * Build the index for all documents.
@@ -392,16 +375,8 @@
     }*/
     
     public void run() {
-        /*IndexEvent event = new IndexEvent();
-        event.setDate(Calendar.getInstance().getTime());
-        event.setType(IndexEvent.STARTTIMEDINDEX);
-        event.setDescription("Start the timed index job");
+    
         try {
-            EventlogFactory.createIndexEventLog().write(event);
-        } catch (Exception e) {
-            log.error("IndexGenerator.run - IndexEventLog can't log the timed indexing start event :"+e.getMessage());
-        }*/
-        try {
             Date since = EventlogFactory.createIndexEventLog().getLastProcessDate();
             index(since);
         } catch (InvalidRequest e) {
@@ -429,15 +404,7 @@
             log.error("IndexGenerator.run - Metadata-Index couldn't generate indexes for those documents which haven't been indexed : "+e.getMessage());
         } catch (FileNotFoundException e) {
             log.error("IndexGenerator.run - Metadata-Index couldn't generate indexes for those documents which haven't been indexed : "+e.getMessage());
-        }
-        /*event.setDate(Calendar.getInstance().getTime());
-        event.setType(IndexEvent.FINISHTIMEDINDEX);
-        event.setDescription("Finish the timed index job");
-        try {
-            EventlogFactory.createIndexEventLog().write(event);
-        } catch (Exception e) {
-            log.error("IndexGenerator.run - IndexEventLog can't log the timed indexing finish event :"+e.getMessage());
-        }*/ catch (ClassNotFoundException e) {
+        } catch (ClassNotFoundException e) {
             // TODO Auto-generated catch block
             log.error("IndexGenerator.run - Metadata-Index couldn't generate indexes for those documents which haven't been indexed : "+e.getMessage());
         } catch (InstantiationException e) {
@@ -620,48 +587,12 @@
      * Generate index for the id.
      */
     private void generateIndex(String id)  {
-        if(id != null)  {
-                SystemMetadata sysmeta = getSystemMetadata(id);
-                //only update none-archived id.
-                //if(sysmeta != null && !sysmeta.getArchived() && sysmeta.getObsoletedBy() == null) {
-                try {
-                    if(sysmeta != null) {
-                        InputStream data = getDataObject(id);
-                        /*Identifier obsolete = sysmeta.getObsoletes();
-                        List<String> obsoleteChain = null;
-                        if(obsolete != null) {
-                            obsoleteChain = getObsoletes(id);
-                        }*/
-                        solrIndex.update(id, sysmeta, data);
-                        try {
-                            Identifier identifier = new Identifier();
-                            identifier.setValue(id);
-                            EventlogFactory.createIndexEventLog().remove(identifier);
-                        } catch (Exception ee) {
-                            log.error("IndexGenerator.index - can't remove the id "+id +" from the index_event table since - "+ee.getMessage());
-                        }
-                    } else {
-                        throw new Exception("IndexGenerator.generate - there is no found SystemMetadata associated with the id "+id);
-                    }
-                } catch (Exception e) {
-                    IndexEvent event = new IndexEvent();
-                    Identifier pid = new Identifier();
-                    pid.setValue(id);
-                    event.setIdentifier(pid);
-                    event.setDate(Calendar.getInstance().getTime());
-                    event.setAction(Event.CREATE);
-                    String error = "IndexGenerator.index - Metacat Index couldn't generate the index for the id - "+id+" because "+e.getMessage();
-                    event.setDescription(error);
-                    try {
-                        EventlogFactory.createIndexEventLog().write(event);
-                    } catch (Exception ee) {
-                        log.error("SolrIndex.insertToIndex - IndexEventLog can't log the index inserting event :"+ee.getMessage());
-                    }
-                    log.error(error);
-                }
-                 
-           
-        }
+        //if id is null and sysmeta will be null. If sysmeta is null, it will be caught in solrIndex.update
+        SystemMetadata sysmeta = getSystemMetadata(id);
+        Identifier pid = new Identifier();
+        pid.setValue(id);
+        solrIndex.update(pid, sysmeta);
+ 
     }
     
     /*
