Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java	(revision 10650)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java	(revision 10651)
@@ -52,6 +52,4 @@
     extends AbstractDocumentRetrieve {
 
-     protected static final String INDEX_STEM_ELEM = "indexStem";
-
     //    protected static final String EXTLINK_PARAM = "ext"; here or in base??    
     protected String index_stem = null;
@@ -80,21 +78,22 @@
 	System.out.println("Configuring AbstractGS2DocumentRetrieve...");
 	//this.config_info = info;
+	
+	// the index stem is either specified in the config file or is  the collection name
+	Element index_stem_elem = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_STEM_ELEM);
+	if (index_stem_elem != null) {
+	    this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT);
+	}
+	if (this.index_stem == null || this.index_stem.equals("")) {
+	    System.err.println("AbstractGS2DocumentRetrieve.configure(): indexStem element not found, stem will default to collection name");
+	    this.index_stem = this.cluster_name;
+	}
 
 	// Open GDBM database for querying
-	String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name);
+	String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem);
 	if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) {
 	    System.err.println("AbstractGS2DocumentRetrieve Error: Could not open GDBM database!");
 	    return false;
 	}
-	
-	// the index stem is either specified in the config file or is  the collection name
-	Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM);
-	if (index_stem_elem != null) {
-	    this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT);
-	}
-	if (this.index_stem == null || this.index_stem.equals("")) {
-	    System.err.println("AbstractGS2DocumentRetrieve.configure(): indexStem element not found, stem will default to collection name");
-	    this.index_stem = this.cluster_name;
-	}
+
 	return true;
     }
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractMGPPSearch.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractMGPPSearch.java	(revision 10650)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractMGPPSearch.java	(revision 10651)
@@ -91,5 +91,4 @@
     private static final int ADVANCED_QUERY = 2;
 
-    protected static final String INDEX_STEM_ELEM = "indexStem";
     protected static final String FIELD_ATT = "field";
     private MGPPWrapper mgpp_src=null;
@@ -135,5 +134,5 @@
 	
 	// the index stem is either specified in the config file or is "index"
-	Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM);
+	Element index_stem_elem = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_STEM_ELEM);
 	if (index_stem_elem != null) {
 	    this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT);
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Browse.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Browse.java	(revision 10650)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Browse.java	(revision 10651)
@@ -68,6 +68,16 @@
 
 	System.err.println("Configuring GS2Browse...");
+	// the index stem is either specified in the config file or is  the collection name
+	Element index_stem_elem = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_STEM_ELEM);
+	String index_stem = null;
+	if (index_stem_elem != null) {
+	    index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT);
+	}
+	if (index_stem == null || index_stem.equals("")) {
+	    index_stem = this.cluster_name;
+	}
+	
 	// Open GDBM database for querying
-	String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name);
+	String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, index_stem);
 	if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) {
 	    System.err.println("GS2Browse Error: Could not open GDBM database!");
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPRetrieve.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPRetrieve.java	(revision 10650)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPRetrieve.java	(revision 10651)
@@ -78,5 +78,5 @@
 	// The location of the MGPP text files
 	mgpp_textdir = GSFile.collectionBaseDir(this.site_home, this.cluster_name) +
-	    File.separatorChar + GSFile.collectionTextPath(this.cluster_name);
+	    File.separatorChar + GSFile.collectionTextPath(this.index_stem);
 
 	// Do generic configuration
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java	(revision 10650)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java	(revision 10651)
@@ -37,4 +37,5 @@
 {
     protected GDBMWrapper gdbm_src = null;
+    protected String index_stem = null;
 
     /** constructor */
@@ -57,5 +58,5 @@
 
     	// Open GDBM database for querying
-	String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name);
+	String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem);
 	if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) {
 	    System.err.println("Error: Could not open GDBM database!");
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java	(revision 10650)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java	(revision 10651)
@@ -77,7 +77,7 @@
 	// The location of the MG index and text files
 	mg_basedir = GSFile.collectionBaseDir(this.site_home, this.cluster_name) + File.separatorChar;  // Needed by MG
-	mg_textdir = GSFile.collectionTextPath(this.cluster_name);
+	mg_textdir = GSFile.collectionTextPath(this.index_stem);
 	// index is only needed to start up MG, not used so just use the default index
-	String indexpath = GSFile.collectionIndexPath(this.cluster_name, this.default_index);
+	String indexpath = GSFile.collectionIndexPath(this.index_stem, this.default_index);
 	this.mg_src.setIndex(indexpath);
 
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java	(revision 10650)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java	(revision 10651)
@@ -56,5 +56,5 @@
 
     	// Open GDBM database for querying
-	String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name);
+	String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem);
 	if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) {
 	    System.err.println("Error: Could not open GDBM database!");
