Index: /greenstone3/trunk/src/java/org/greenstone/gsdl3/service/AbstractSearch.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/gsdl3/service/AbstractSearch.java	(revision 20239)
+++ /greenstone3/trunk/src/java/org/greenstone/gsdl3/service/AbstractSearch.java	(revision 20240)
@@ -244,12 +244,16 @@
     }
 
+    protected void createParameter(String name, Element param_list, String lang) {
+      createParameter(name, param_list, lang, null);
+    }
     /** default implementations for the standard parameters plus some 
      * other common ones 
      * index, maxDocs, hitsPerPage, startPage, query, case, stem, 
     */
-    protected void createParameter(String name, Element param_list, String lang) {
+     protected void createParameter(String name, Element param_list, String lang, String default_value) {
 	Element param = null;
+	String param_default = default_value;
 	if (name.equals(QUERY_PARAM)) {
-	    param = GSXML.createParameterDescription(this.doc, QUERY_PARAM, getTextString("param."+QUERY_PARAM, lang), GSXML.PARAM_TYPE_STRING, null, null, null);
+	    param = GSXML.createParameterDescription(this.doc, QUERY_PARAM, getTextString("param."+QUERY_PARAM, lang), GSXML.PARAM_TYPE_STRING, param_default, null, null);
 	    param_list.appendChild(param);
 	} else if (name.equals(INDEX_PARAM)) {
@@ -263,5 +267,8 @@
 		param_type = GSXML.PARAM_TYPE_ENUM_MULTI;
 	    }
-	    param = GSXML.createParameterDescription2(this.doc, INDEX_PARAM, getTextString("param."+INDEX_PARAM, lang), param_type, this.default_index, index_ids, index_names);
+	    if (param_default == null) {
+	      param_default = this.default_index;
+	    }
+	    param = GSXML.createParameterDescription2(this.doc, INDEX_PARAM, getTextString("param."+INDEX_PARAM, lang), param_type, param_default, index_ids, index_names);
 	    param_list.appendChild(param);
 	}
@@ -276,5 +283,8 @@
 		param_type = GSXML.PARAM_TYPE_ENUM_MULTI;
 	    }
-	    param = GSXML.createParameterDescription2(this.doc, INDEX_SUBCOLLECTION_PARAM, getTextString("param."+INDEX_SUBCOLLECTION_PARAM, lang), param_type, this.default_index_subcollection, index_sub_ids, index_sub_names);
+	    if (param_default == null) {
+	      param_default = this.default_index_subcollection;
+	    }
+	    param = GSXML.createParameterDescription2(this.doc, INDEX_SUBCOLLECTION_PARAM, getTextString("param."+INDEX_SUBCOLLECTION_PARAM, lang), param_type, param_default, index_sub_ids, index_sub_names);
 	    param_list.appendChild(param);
 	}
@@ -289,28 +299,50 @@
 		param_type = GSXML.PARAM_TYPE_ENUM_MULTI;
 	    }
-	    param = GSXML.createParameterDescription2(this.doc, INDEX_LANGUAGE_PARAM, getTextString("param."+INDEX_LANGUAGE_PARAM, lang), param_type, this.default_index_language, index_lang_ids, index_lang_names);
+	    if (param_default == null) {
+	      param_default = this.default_index_language;
+	    }
+	    param = GSXML.createParameterDescription2(this.doc, INDEX_LANGUAGE_PARAM, getTextString("param."+INDEX_LANGUAGE_PARAM, lang), param_type, param_default, index_lang_ids, index_lang_names);
 	    param_list.appendChild(param);
 	}
         else if (name.equals(MAXDOCS_PARAM)) {
-	    param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, this.default_max_docs, null, null);
+	  if (param_default == null) {
+	    param_default = this.default_max_docs;
+	  }
+
+	    param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, param_default, null, null);
 	    param_list.appendChild(param);
 	}
 	else if(name.equals(HITS_PER_PAGE_PARAM)){
-	     param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, this.default_hits_per_page, null, null);
+	  if (param_default == null) {
+	    param_default = this.default_hits_per_page;
+	  }
+	  
+	     param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, param_default, null, null);
 	    param_list.appendChild(param);
 	}
 	else if (name.equals(CASE_PARAM) || name.equals(STEM_PARAM) || name.equals(ACCENT_PARAM)) {
+	  if (param_default == null) {
+	    param_default = BOOLEAN_PARAM_OFF;
+	  }
 	    String[] bool_ops = {"0", "1"};
 	    String[] bool_texts = {getTextString("param.boolean.off", lang),getTextString("param.boolean.on", lang)}; 
-	    param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_BOOLEAN, BOOLEAN_PARAM_ON, bool_ops, bool_texts);
+	    param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_BOOLEAN, param_default, bool_ops, bool_texts);
 	    param_list.appendChild(param);
 	} else if (name.equals(MATCH_PARAM)) {
+	  if (param_default == null) {
+	    param_default = MATCH_PARAM_SOME;
+	  }
+	  
 	    String[] vals = {MATCH_PARAM_SOME, MATCH_PARAM_ALL };
 	    String[] val_texts = {getTextString("param."+MATCH_PARAM+"."+MATCH_PARAM_SOME, lang), getTextString("param."+MATCH_PARAM+"."+MATCH_PARAM_ALL, lang)}; 
-	    param = GSXML.createParameterDescription(this.doc, MATCH_PARAM, getTextString("param."+MATCH_PARAM, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, MATCH_PARAM_SOME, vals, val_texts);
+	    param = GSXML.createParameterDescription(this.doc, MATCH_PARAM, getTextString("param."+MATCH_PARAM, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, param_default, vals, val_texts);
 	    param_list.appendChild(param);
 	} else if (name.equals(START_PAGE_PARAM)) {
+	  if (param_default == null) {
+	    param_default = "1";
+	  }
+	  
 	    // start page - set to 1 for the search page
-	    param = GSXML.createParameterDescription(this.doc, START_PAGE_PARAM, "", GSXML.PARAM_TYPE_INVISIBLE, "1", null, null);
+	    param = GSXML.createParameterDescription(this.doc, START_PAGE_PARAM, "", GSXML.PARAM_TYPE_INVISIBLE, param_default, null, null);
 	    param_list.appendChild(param);
 	}
