Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java	(revision 13908)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java	(revision 13911)
@@ -89,6 +89,5 @@
    // the default level for retrieval - and we'll use it for searching too
     protected String default_level=null;
-    // the default field for searching
-    protected String default_field = null;
+
     // which search services will we offer??
     protected boolean plain_search = false;
@@ -161,21 +160,9 @@
 	}
 
-	// set up the extra services which are available for this collection
-	// check the config info - if there is no field list, then there is no fielded searching
-	
-	Element field_list = (Element) GSXML.getChildByTagName(info, GSXML.FIELD_ELEM+GSXML.LIST_MODIFIER);
-	if (field_list==null) {
-	    // nothing more to do
-	    return true;
-	}
-
+	
 	// the format info is the same for all services
 	Element format_info = (Element)format_info_map.get(TEXT_QUERY_SERVICE);
-
-	// find the default field - use the first one
-	Element first_field = (Element)GSXML.getChildByTagName(field_list, GSXML.FIELD_ELEM);
-	default_field = first_field.getAttribute(GSXML.SHORTNAME_ATT);
-	// else set up the fielded query services
-	
+	
+	// set up the extra services which are available for this collection
 	if (this.simple_form_search) {
 	    // set up short_service_info_ - for now just has id and type - name will be added in on the fly
@@ -348,29 +335,4 @@
 	
     }
-    protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang){
-	// we currently only have one index, and use the field data as the index
-		    
-	// the field list -  read from config file
-	Element field_list = (Element)GSXML.getChildByTagName(this.config_info, GSXML.FIELD_ELEM+GSXML.LIST_MODIFIER);
-	NodeList fields = field_list.getElementsByTagName(GSXML.FIELD_ELEM);
-	for (int i=0; i< fields.getLength();i++) {
-	    String shortname = ((Element)fields.item(i)).getAttribute(GSXML.SHORTNAME_ATT);
-	    String name = ((Element)fields.item(i)).getAttribute(GSXML.NAME_ATT);
-	    if (name.equals("")) {
-		// no name, ignore
-		continue;
-	    }
-	    // TODO change field so that name is the id, and full metadata name is somthing else
-	    if (shortname.equals("")) {
-		shortname = name;
-	    }
-	    index_ids.add(shortname);
-	    // should these be changed to a text element based on lang?
-	    // or is the name of a metadata element eg dc:Title its 
-	    // name in all langs
-	    index_names.add(name);
-	}
-    }
-
 
     // the following three functions are needed so the base class can 
@@ -441,5 +403,5 @@
 	String field = (String) params.get(INDEX_PARAM); 
 	if (field == null) {
-	    field = default_field;
+	    field = default_index;
 	}
 	
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2Search.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2Search.java	(revision 13908)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2Search.java	(revision 13911)
@@ -97,5 +97,5 @@
 	Element def = (Element) GSXML.getChildByTagName(info, DEFAULT_INDEX_ELEM);
 	if (def != null) {
-	    this.default_index = def.getAttribute(GSXML.NAME_ATT);
+	    this.default_index = def.getAttribute(GSXML.SHORTNAME_ATT);
 	} // otherwise will be "", and the first one will be the default
 
@@ -178,4 +178,29 @@
     }
 
+    protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang) {
+	// the index info -
+	Element index_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_ELEM+GSXML.LIST_MODIFIER);
+	NodeList indexes = index_list.getElementsByTagName(INDEX_ELEM);
+	int len = indexes.getLength();
+	// now add even if there is only one
+	for (int i=0; i<len; i++) {
+	    Element index = (Element)indexes.item(i);
+	    String shortname = index.getAttribute(GSXML.SHORTNAME_ATT);
+	    if (shortname.equals("")) {
+		continue;
+	    }
+	    index_ids.add(shortname);
+	    String display_name = GSXML.getDisplayText(index, GSXML.DISPLAY_TEXT_NAME, lang, "en");
+	    if (display_name.equals("")) {
+		display_name = index.getAttribute(GSXML.NAME_ATT);
+		if (display_name.equals("")) {
+		    display_name = shortname;
+		}
+	    }
+	    index_names.add(display_name);
+		
+	}
+	
+    }
 
     protected void addCustomQueryParams(Element param_list, String lang) 
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java	(revision 13908)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java	(revision 13911)
@@ -86,7 +86,6 @@
     {
 	super.addCustomQueryParams(param_list, lang);
-	/** lucenes rank param is based on fields, not ranked/not */
+	/** lucenes rank param is based on index fields, not ranked/not */
 	createParameter(RANK_PARAM, param_list, lang);
-	createParameter(FIELD_ATT, param_list, lang);
     }
     
@@ -113,30 +112,28 @@
     }
     
-    protected void getSortByIndexData(ArrayList index_ids, ArrayList index_names, String lang){
-	// the field list -  read from config file
-	Element field_list = (Element)GSXML.getChildByTagName(this.config_info, GSXML.FIELD_ELEM+GSXML.LIST_MODIFIER);
-	NodeList fields = field_list.getElementsByTagName(GSXML.FIELD_ELEM);
-	for (int i=0; i< fields.getLength();i++) {
-	    String shortname = ((Element)fields.item(i)).getAttribute(GSXML.SHORTNAME_ATT);
-	    String name = ((Element)fields.item(i)).getAttribute(GSXML.NAME_ATT);
-	    if (name.equals("")) {
-		// no name, ignore
-		continue;
-	    }
-	    // TODO change field so that name is the id, and full metadata name is somthing else
-	    
-	    if (shortname.equals("")) {
-		shortname = name;
-	    }
-	    if (shortname.equals("ZZ") || shortname.equals("TX")) {
-		// ZZ is a fake index, and we don't sort by TX
+    protected void getSortByIndexData(ArrayList index_ids, ArrayList index_names, String lang) {
+	// the index info -
+	Element index_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_ELEM+GSXML.LIST_MODIFIER);
+	NodeList indexes = index_list.getElementsByTagName(INDEX_ELEM);
+	int len = indexes.getLength();
+	// now add even if there is only one
+	for (int i=0; i<len; i++) {
+	    Element index = (Element)indexes.item(i);
+	    String shortname = index.getAttribute(GSXML.SHORTNAME_ATT);
+	    if (shortname.equals("") || shortname.equals("ZZ") || shortname.equals("TX")) {
 		continue;
 	    }
 	    index_ids.add("by"+shortname);
-	    // should these be changed to a text element based on lang?
-	    // or is the name of a metadata element eg dc:Title its 
-	    // name in all langs
-	    index_names.add(name);
-	}
+	    String display_name = GSXML.getDisplayText(index, GSXML.DISPLAY_TEXT_NAME, lang, "en");
+	    if (display_name.equals("")) {
+		display_name = index.getAttribute(GSXML.NAME_ATT);
+		if (display_name.equals("")) {
+		    display_name = shortname;
+		}
+	    }
+	    index_names.add(display_name);
+		
+	}
+	
     }
 
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java	(revision 13908)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java	(revision 13911)
@@ -50,4 +50,6 @@
     private MGPPWrapper mgpp_src=null;
 
+    private String physical_index_name = "idx";
+    
     static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.GS2MGPPSearch.class.getName());
 
@@ -91,5 +93,5 @@
     protected boolean setUpQueryer(HashMap params) {
 	// set up mgpp_src
-	String indexdir = GSFile.collectionBaseDir(this.site_home, this.cluster_name) + File.separatorChar + GSFile.collectionIndexPath(this.index_stem, this.default_index);
+	String indexdir = GSFile.collectionBaseDir(this.site_home, this.cluster_name) + File.separatorChar + GSFile.collectionIndexPath(this.index_stem, this.physical_index_name);
 	this.mgpp_src.loadIndexData(indexdir);
 
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java	(revision 13908)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java	(revision 13911)
@@ -72,5 +72,5 @@
 	Element def = (Element) GSXML.getChildByTagName(info, DEFAULT_INDEX_ELEM);
 	if (def != null) {
-	    this.default_index = def.getAttribute(GSXML.NAME_ATT);
+	    this.default_index = def.getAttribute(GSXML.SHORTNAME_ATT);
 	}
 	if (this.default_index == null || this.default_index.equals("")) {
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java	(revision 13908)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java	(revision 13911)
@@ -79,18 +79,4 @@
     
 
-    protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang) {
-	// the index info -
-	Element index_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_ELEM+GSXML.LIST_MODIFIER);
-	NodeList indexes = index_list.getElementsByTagName(INDEX_ELEM);
-	int len = indexes.getLength();
-	// now add even if there is only one
-	for (int i=0; i<len; i++) {
-	    Element index = (Element)indexes.item(i);
-	    index_ids.add(index.getAttribute(GSXML.NAME_ATT));
-	    index_names.add(GSXML.getDisplayText(index, GSXML.DISPLAY_TEXT_NAME, lang, "en"));
-		
-	}
-
-    }
 
     /** do the actual query */
