Project

General

Profile

« Previous | Next » 

Revision 7769

Added by Jing Tao over 11 years ago

If the solr engine is disabled, the metacat index will do nothing.

View differences:

metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/MetacatIndexServlet.java
44 44
import org.apache.commons.logging.LogFactory;
45 45
import org.dataone.configuration.Settings;
46 46

  
47
import edu.ucsb.nceas.metacat.common.query.EnabledQueryEngines;
47 48

  
49

  
48 50
/**
49 51
 * A servlet class for the Metadata Index module. This class only does one thing - initialize the ApplicationController class.
50 52
 * @author tao
......
65 67
        //System.out.println("++++++++++++++++++++++++------------------- start the servlet");
66 68
    	
67 69
    	initializeSharedConfiguration(config);
68
		
70
    	boolean isSolrEnabled = true;
71
    	try {
72
    	   isSolrEnabled = EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.SOLRENGINE);
73
    	} catch (Exception e) {
74
    	    throw new ServletException(e.getMessage());
75
    	}
76
    	//if the solr query engine is disabled, we stop here.
77
    	if(!isSolrEnabled) {
78
    	    return;
79
    	}
69 80
    	// initialize the application using the configured application-context
70 81
        URL url = getClass().getResource("/index-processor-context.xml");
71 82
        //System.out.println("the url is "+url);

Also available in: Unified diff