Index: /gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java
===================================================================
--- /gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java	(revision 25891)
+++ /gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java	(revision 25892)
@@ -74,8 +74,6 @@
 
 				String solr_home_str = GSFile.extHome(gsdl3_home, solr_ext_name);
-				File solr_home = new File(solr_home_str);
-				File solr_xml = new File(solr_home, "solr.xml");
-
-				all_solr_cores = new CoreContainer(solr_home_str, solr_xml);
+
+				all_solr_cores = new CoreContainer(solr_home_str);
 			}
 			catch (Exception e)
@@ -91,9 +89,33 @@
 	public boolean configure(Element info, Element extra_info)
 	{
-		if (!super.configure(info, extra_info))
-		{
-			return false;
-		}
-
+		boolean success = super.configure(info, extra_info);
+
+		// 1. Make the CoreContainer reload solr.xml
+		// This is particularly needed for when activate.pl is executed during
+		// a running GS3 server. At that point, the solr collection is reactivated and 
+		// we need to tell Greenstone that the solr index has changed. This requires
+		// the CoreContainer to reload the solr.xml file, and it all works again.
+
+		solr_core_cache.clear(); // clear the map of existing solr cores
+	    
+		// Reload the updated solr.xml into the CoreContainer
+		// (Doing an all_solr_cores.shutdown() first doesn't seem to be required)
+		try { 	
+		    String solr_home_str = all_solr_cores.getSolrHome();
+		    File solr_home = new File(solr_home_str);
+		    File solr_xml = new File( solr_home,"solr.xml" );
+		    
+		    all_solr_cores.load(solr_home_str,solr_xml);
+		} catch (Exception e) {
+		    logger.error("Exception in GS2SolrSearch.configure(): " + e.getMessage());
+		    e.printStackTrace();
+		    return false;
+		}
+		
+		if(!success) {
+		    return false;
+		}
+		
+		// 2. Setting up facets
 		Element searchElem = (Element) GSXML.getChildByTagName(extra_info, GSXML.SEARCH_ELEM);
 		NodeList configIndexElems = searchElem.getElementsByTagName(GSXML.INDEX_ELEM);
Index: /main/trunk/greenstone2/bin/script/activate.pl
===================================================================
--- /main/trunk/greenstone2/bin/script/activate.pl	(revision 25891)
+++ /main/trunk/greenstone2/bin/script/activate.pl	(revision 25892)
@@ -430,9 +430,10 @@
     my $build_dir = undef;
 	my $index_dir = undef;
-    my $site = undef;
+	my $site = undef;
 	
 	my $removeold = 0;
 	my $keepold = 0;
-	
+	my $incremental = 0; # used by solr
+
 	my $library_url = undef; # to be specified on the cmdline if not using a GS-included web server
 	
@@ -455,4 +456,7 @@
 		elsif ($arg eq "-keepold") {
 			$keepold = 1;
+		}
+		elsif ($arg eq "-incremental") {
+			$incremental = 1;
 		}
 		elsif ($arg eq "-library_url") {
@@ -595,6 +599,8 @@
 	# If keepold: move building's contents into index, where only duplicates will get deleted.
 	# removeold and keepold can't both be on at the same time
-	($removeold, $keepold) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, 
-						   0, # incremental is irrelevant to what activate.pl does, setting this = 0
+        # incremental becomes relevant for solr, though it was irrelevant to what activate.pl does (moving building to index)
+	my $incremental_mode;
+	($removeold, $keepold, $incremental, $incremental_mode) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, 
+						   $incremental,
 						   $build_dir, # checkdir. Usually archives or export to be deleted. activate.pl deletes building 
 						   $collectcfg);
@@ -639,6 +645,6 @@
 		}
 	}
-	elsif ($keepold) {
-	    	if ($buildtype eq "solr") { ### no building- prefix for keepold incremental case?
+	elsif ($keepold || $incremental) {
+	    	if ($buildtype eq "solr") {
 		    # if solr, remove any cores that may be using the building_dir before moving this dir onto index
 		    foreach my $corename (@corenames) {			
@@ -652,13 +658,21 @@
 		&util::mv_dir_contents($build_dir, $index_dir);
 	}
-	
+
     if ($buildtype eq "solr") {
-	# Call CREATE action to get all cores pointing to the index folder, since building is now index
-	### Should already be using the index_dir directory for $keepold (incremental) case? Then call RELOAD CORE
+	# Call CREATE action to get the old cores pointing to the index folder
 	foreach my $corename (@corenames) {
 	    if($removeold) {
+		# Call CREATE action to get all cores pointing to the index folder, since building is now index
 		$solr_server->admin_create_core($corename, $index_dir);
-	    } elsif ($keepold) {
-		$solr_server->admin_reload_core($corename); 
+		
+	    } elsif ($keepold || $incremental) { 
+		# Call RELOAD core. Should already be using the index_dir directory for $keepold and $incremental case
+		
+		# Ping to see if corename exists, if it does, reload, else create
+		if ($solr_server->admin_ping_core($corename)) {
+		    $solr_server->admin_reload_core($corename); 
+		} else {
+		    $solr_server->admin_create_core($corename, $index_dir);
+		}
 	    }
 	}
