Index: metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexTest.java
===================================================================
--- metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexTest.java	(revision 7547)
+++ metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexTest.java	(revision 7548)
@@ -16,6 +16,7 @@
     
     private static final String SYSTEMMETAFILEPATH = "src/test/resources/eml-system-meta-example.xml";
     private static final String EMLFILEPATH = "src/test/resources/eml-example.xml";
+    private static final String id = "urn:uuid:606a19dd-b531-4bf4-b5a5-6d06c3d39098";
     
     /**
      * Test building index for an insert.
@@ -25,11 +26,20 @@
        SolrIndex solrIndex = generateSolrIndex();
        InputStream systemInputStream = new FileInputStream(new File(SYSTEMMETAFILEPATH));
        InputStream emlInputStream = new FileInputStream(new File(EMLFILEPATH));
-       String id = "urn:uuid:606a19dd-b531-4bf4-b5a5-6d06c3d39098";
        solrIndex.insert(id, systemInputStream, emlInputStream);
        
     }
     
+    /**
+     * Test building index for an insert.
+     */
+    @Test
+    public void testDelete() throws Exception {
+       SolrIndex solrIndex = generateSolrIndex();
+       solrIndex.remove(id);
+       
+    }
+    
     private SolrIndex generateSolrIndex() throws Exception {
         ApplicationController controller = new ApplicationController();
         List<SolrIndex> list = controller.getSolrIndexes();
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 7547)
+++ metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SolrIndex.java	(revision 7548)
@@ -48,9 +48,11 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
 import org.apache.solr.client.solrj.impl.HttpSolrServer;
 import org.apache.solr.client.solrj.response.UpdateResponse;
 import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.core.CoreContainer;
 import org.dataone.cn.indexer.XMLNamespaceConfig;
 import org.dataone.cn.indexer.XPathDocumentParser;
 import org.dataone.cn.indexer.parser.IDocumentSubprocessor;
@@ -68,8 +70,12 @@
  */
 public class SolrIndex {
     
-    //private static final String INPUT_ENCODING = "UTF-8";
-    public static final String METACATPIDFIELD = "id";
+    private static final String SOLRHOMEPATH = "/Users/tao/Downloads/apache-solr-3.6.2/example/solr";
+    
+    private static final String SOLRHOME = "solr.solr.home";
+    private static final String SOLRSERVERNAME = "metacat-core";
+    
+    
     private List<IDocumentSubprocessor> subprocessors = null;
     private SolrServer solrServer = null;
     private XMLNamespaceConfig xmlNamespaceConfig = null;
@@ -96,15 +102,24 @@
     
     /**
      * Constructor
+     * @throws SAXException 
+     * @throws IOException 
      */
     public SolrIndex(List<SolrField> sysmetaSolrFields, XMLNamespaceConfig xmlNamespaceConfig)
-                    throws XPathExpressionException, ParserConfigurationException {
-                this.xmlNamespaceConfig = xmlNamespaceConfig;
-                this.sysmetaSolrFields = sysmetaSolrFields;
-                solrServer = new HttpSolrServer("http://localhost:8080/solr/");
-                init();
+                    throws XPathExpressionException, ParserConfigurationException, IOException, SAXException {
+         this.xmlNamespaceConfig = xmlNamespaceConfig;
+         this.sysmetaSolrFields = sysmetaSolrFields;
+         initSolrServer();
+         init();
     }
     
+    private void initSolrServer() throws IOException, ParserConfigurationException, SAXException {
+        System.setProperty(SOLRHOME, SOLRHOMEPATH);
+        CoreContainer.Initializer init = new CoreContainer.Initializer();
+        CoreContainer c = init.initialize();
+        solrServer = new EmbeddedSolrServer(c, "collection1");
+    }
+    
     private void init() throws ParserConfigurationException, XPathExpressionException {
         xpath.setNamespaceContext(xmlNamespaceConfig);
         initExpressions();
@@ -271,7 +286,7 @@
                                 if(field != null) {
                                     String value = field.getValue();
                                     String name = field.getName();
-                                    //System.out.println("add name/value pair - "+name+"/"+value);
+                                    System.out.println("add name/value pair - "+name+"/"+value);
                                     solrDoc.addField(name, value);
                                 }
                             }
@@ -281,7 +296,7 @@
                 if(!solrDoc.isEmpty()) {
                     UpdateResponse response = solrServer.add(solrDoc);
                     solrServer.commit();
-                    //System.out.println("=================the response is:\n"+response.toString());
+                    System.out.println("=================the response is:\n"+response.toString());
                 }
             }
         }
@@ -294,7 +309,8 @@
      * @throws SolrServerException
      */
     public void remove(String pid) throws IOException, SolrServerException {
-        solrServer.deleteByQuery(METACATPIDFIELD + ":" + pid);
+        solrServer.deleteById(pid);
+        solrServer.commit();
        
     }
 }
Index: metacat-index/pom.xml
===================================================================
--- metacat-index/pom.xml	(revision 7547)
+++ metacat-index/pom.xml	(revision 7548)
@@ -44,7 +44,12 @@
     <dependency>
         <groupId>org.apache.solr</groupId>
         <artifactId>solr-solrj</artifactId>
-        <version>4.1.0</version>
+        <version>3.6.2</version>
     </dependency>
+    <dependency>
+        <groupId>org.apache.solr</groupId>
+        <artifactId>solr-core</artifactId>
+        <version>3.6.2</version>
+    </dependency>
   </dependencies>
 </project>
