Changeset 9902
- Timestamp:
- 2005-05-17T14:22:58+12:00 (19 years ago)
- Location:
- trunk/gsdl3/src/java/org/greenstone/gsdl3/service
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractMGPPSearch.java
r9874 r9902 95 95 private MGPPWrapper mgpp_src=null; 96 96 97 /** the default index */98 protected String default_index = null;99 97 // the default level for retrieval - and we'll use it for searching too 100 98 private String default_level=null; … … 134 132 if (def != null) { 135 133 this.default_index = def.getAttribute(GSXML.NAME_ATT); 136 } 137 if (this.default_index == null || this.default_index.equals("")) { 138 System.err.println("Error: default index not specified!"); 139 return false; 140 } 134 } // otherwise its "" and will be the first one in the list 135 141 136 // the index stem is either specified in the config file or is "index" 142 137 Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM); … … 149 144 } 150 145 151 146 // the generic config has set up the text query service, but we may not want it 152 147 Element search_type_list = (Element) GSXML.getChildByTagName(info, SEARCH_TYPE_ELEM + GSXML.LIST_MODIFIER); 153 148 if (search_type_list == null) { -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractMGSearch.java
r9874 r9902 65 65 protected static final String INDEX_ELEM = "index"; 66 66 67 /** the default index */68 protected String default_index = null;69 67 /** the stem used for the index files */ 70 68 protected String index_stem = null; … … 93 91 if (def != null) { 94 92 this.default_index = def.getAttribute(GSXML.NAME_ATT); 95 } 96 if (this.default_index == null || this.default_index.equals("")) { 97 System.err.println("Error: default index not specified!"); 98 return false; 99 } 93 } // otherwise will be "", and the first one will be the default 100 94 101 95 // the index stem is either the collection name or is specified in the config file … … 148 142 } 149 143 150 protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang) 151 { 152 // the index info - read from config file - cache it?? 144 protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang) { 145 // the index info - 153 146 Element index_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_ELEM+GSXML.LIST_MODIFIER); 154 147 NodeList indexes = index_list.getElementsByTagName(INDEX_ELEM); … … 163 156 164 157 } 165 166 158 /** do the actual query */ 167 159 protected Element processTextQuery(Element request) -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java
r9435 r9902 71 71 */ 72 72 protected String default_document_type = null; 73 /** the default index, or comma separated list if more than one is 74 * the default (with start and end commas, eg ,TI,SU,). 75 * Should be set by configure() 76 */ 77 protected String default_index = ""; 73 78 74 79 public AbstractSearch() … … 207 212 param_type = GSXML.PARAM_TYPE_ENUM_MULTI; 208 213 } 209 param = GSXML.createParameterDescription2(this.doc, INDEX_PARAM, getTextString("param."+INDEX_PARAM, lang), param_type, /*this.default_index*/"", index_ids, index_names);214 param = GSXML.createParameterDescription2(this.doc, INDEX_PARAM, getTextString("param."+INDEX_PARAM, lang), param_type, this.default_index, index_ids, index_names); 210 215 param_list.appendChild(param); 211 216 } else if (name.equals(MAXDOCS_PARAM)) { -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/IViaSearch.java
r9874 r9902 51 51 does_paging = true; 52 52 does_multi_index_search = true; 53 this.default_index = ",kw,au,su,ti,de,fu,"; // all of them 53 54 return super.configure(info, extra_info); 54 55 }
Note:
See TracChangeset
for help on using the changeset viewer.