Changeset 25892 for gs3-extensions/solr/trunk/src/src/java/org
- Timestamp:
- 2012-07-03T19:53:05+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java
r25886 r25892 74 74 75 75 String solr_home_str = GSFile.extHome(gsdl3_home, solr_ext_name); 76 File solr_home = new File(solr_home_str); 77 File solr_xml = new File(solr_home, "solr.xml"); 78 79 all_solr_cores = new CoreContainer(solr_home_str, solr_xml); 76 77 all_solr_cores = new CoreContainer(solr_home_str); 80 78 } 81 79 catch (Exception e) … … 91 89 public boolean configure(Element info, Element extra_info) 92 90 { 93 if (!super.configure(info, extra_info)) 94 { 95 return false; 96 } 97 91 boolean success = super.configure(info, extra_info); 92 93 // 1. Make the CoreContainer reload solr.xml 94 // This is particularly needed for when activate.pl is executed during 95 // a running GS3 server. At that point, the solr collection is reactivated and 96 // we need to tell Greenstone that the solr index has changed. This requires 97 // the CoreContainer to reload the solr.xml file, and it all works again. 98 99 solr_core_cache.clear(); // clear the map of existing solr cores 100 101 // Reload the updated solr.xml into the CoreContainer 102 // (Doing an all_solr_cores.shutdown() first doesn't seem to be required) 103 try { 104 String solr_home_str = all_solr_cores.getSolrHome(); 105 File solr_home = new File(solr_home_str); 106 File solr_xml = new File( solr_home,"solr.xml" ); 107 108 all_solr_cores.load(solr_home_str,solr_xml); 109 } catch (Exception e) { 110 logger.error("Exception in GS2SolrSearch.configure(): " + e.getMessage()); 111 e.printStackTrace(); 112 return false; 113 } 114 115 if(!success) { 116 return false; 117 } 118 119 // 2. Setting up facets 98 120 Element searchElem = (Element) GSXML.getChildByTagName(extra_info, GSXML.SEARCH_ELEM); 99 121 NodeList configIndexElems = searchElem.getElementsByTagName(GSXML.INDEX_ELEM);
Note:
See TracChangeset
for help on using the changeset viewer.