Index: src/edu/ucsb/nceas/metacat/IndexingQueue.java
===================================================================
--- src/edu/ucsb/nceas/metacat/IndexingQueue.java	(revision 8163)
+++ src/edu/ucsb/nceas/metacat/IndexingQueue.java	(revision 8164)
@@ -33,6 +33,7 @@
 import java.util.HashMap;
 import java.lang.Comparable;
 
+import edu.ucsb.nceas.metacat.common.query.EnabledQueryEngines;
 import edu.ucsb.nceas.metacat.database.DBConnection;
 import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.properties.PropertyService;
@@ -65,6 +66,9 @@
 	}
 
     private IndexingQueue() {
+        if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) {
+            return;
+        }
 	    for (int i = 0; i < NUMBEROFINDEXINGTHREADS; i++) {
 	    	IndexingTask thread = new IndexingTask();
 	    	thread.start();
@@ -80,6 +84,9 @@
 	}//getInstance
 
     public void add(String docid, String rev) {
+        if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) {
+            return;
+        }
     	add(new IndexingQueueObject(docid, rev, 0));
     }
     
@@ -103,6 +110,9 @@
 	}
 	
 	public void setMetacatRunning(boolean metacatRunning){
+	    if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) {
+            return;
+        }
 		this.metacatRunning = metacatRunning;
 		
 		if(!metacatRunning){
@@ -143,6 +153,9 @@
      * @param rev the docid's rev (ignored)
      */
     public void remove(String docid, String rev) {
+        if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) {
+            return;
+        }
 		synchronized (indexingMap) {
 			if (indexingMap.containsKey(docid)) {
 				logMetacat.debug("Removing indexing queue task for docid: " + docid);
Index: src/edu/ucsb/nceas/metacat/IndexingTimerTask.java
===================================================================
--- src/edu/ucsb/nceas/metacat/IndexingTimerTask.java	(revision 8163)
+++ src/edu/ucsb/nceas/metacat/IndexingTimerTask.java	(revision 8164)
@@ -33,6 +33,7 @@
 import java.util.Vector;
 import java.util.Iterator;
 
+import edu.ucsb.nceas.metacat.common.query.EnabledQueryEngines;
 import edu.ucsb.nceas.metacat.database.DBConnection;
 import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.database.DatabaseService;
@@ -55,6 +56,9 @@
 	     */
 	    public void run()
 	    {
+	        if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) {
+	            return;
+	        }
 	    	DBConnection dbConn = null;
 	    	int serialNumber = 0;
 	    	try{
Index: src/edu/ucsb/nceas/metacat/DocumentImpl.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DocumentImpl.java	(revision 8163)
+++ src/edu/ucsb/nceas/metacat/DocumentImpl.java	(revision 8164)
@@ -62,6 +62,7 @@
 import edu.ucsb.nceas.utilities.access.AccessControlInterface;
 import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList;
 import edu.ucsb.nceas.metacat.client.InsufficientKarmaException;
+import edu.ucsb.nceas.metacat.common.query.EnabledQueryEngines;
 import edu.ucsb.nceas.metacat.database.DBConnection;
 import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.database.DatabaseService;
@@ -1705,6 +1706,10 @@
 	 */
     public void buildIndex() throws McdbException
     {
+        //if the pathquery option is off, we don't need to build the index.
+        if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) {
+            return;
+        }
     	logMetacat.info("DocumentImpl.buildIndex - building index for docid " + docid);
     	double start = System.currentTimeMillis()/1000;
         TreeSet<NodeRecord> nodeRecordLists = getNodeRecordList(rootnodeid);
Index: src/edu/ucsb/nceas/metacat/MetacatHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/MetacatHandler.java	(revision 8163)
+++ src/edu/ucsb/nceas/metacat/MetacatHandler.java	(revision 8164)
@@ -84,6 +84,7 @@
 import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList;
 import edu.ucsb.nceas.metacat.cart.CartManager;
 import edu.ucsb.nceas.metacat.client.InsufficientKarmaException;
+import edu.ucsb.nceas.metacat.common.query.EnabledQueryEngines;
 import edu.ucsb.nceas.metacat.database.DBConnection;
 import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.dataone.SystemMetadataFactory;
@@ -2537,6 +2538,12 @@
         try {
             response.setContentType("text/xml");
             PrintWriter out = response.getWriter();
+            if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) {
+                out.print("<error>");
+                out.print(DBQuery.XPATHQUERYOFFINFO);
+                out.print("</error>");
+                return;
+            }
             
             // Check that the user is authenticated as an administrator account
             if (!AuthUtil.isAdministrator(username, groups)) {
@@ -2690,6 +2697,10 @@
      * @param out the PrintWriter to which output is printed
      */
     private void buildDocumentIndex(String docid, PrintWriter out) {
+        //if the pathquery option is off, we don't need to build index.
+        if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) {
+            return;
+        }
         try {
             DocumentImpl doc = new DocumentImpl(docid, false);
             doc.buildIndex();
Index: src/edu/ucsb/nceas/metacat/DBQuery.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBQuery.java	(revision 8163)
+++ src/edu/ucsb/nceas/metacat/DBQuery.java	(revision 8164)
@@ -88,6 +88,7 @@
 public class DBQuery
 {
 
+    public static final String XPATHQUERYOFFINFO = "The Metacat Path Query Engine is turned off. If you want to turn it on, please contact the administrator.";
     static final int ALL = 1;
 
     static final int WRITE = 2;
@@ -340,7 +341,7 @@
               String output = "";
               output += "<?xml version=\"1.0\"?>";
               output += "<error>";
-              output += "The Metacat Path Query is turned off. If you want to turn it on, please contact the administrator.";
+              output += XPATHQUERYOFFINFO;
               output += "</error>";
               out.write(output);
               out.close();
