Changeset 9902


Ignore:
Timestamp:
2005-05-17T14:22:58+12:00 (19 years ago)
Author:
kjdon
Message:

added back in teh default index stuff - wasn't being used in the index param description

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  
    9595    private MGPPWrapper mgpp_src=null;
    9696
    97      /** the default index */
    98     protected String default_index = null;
    9997   // the default level for retrieval - and we'll use it for searching too
    10098    private String default_level=null;
     
    134132    if (def != null) {
    135133        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   
    141136    // the index stem is either specified in the config file or is "index"
    142137    Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM);
     
    149144    }
    150145
    151         // the generic config has set up the text query service, but we may not want it
     146    // the generic config has set up the text query service, but we may not want it
    152147    Element search_type_list = (Element) GSXML.getChildByTagName(info, SEARCH_TYPE_ELEM + GSXML.LIST_MODIFIER);
    153148    if (search_type_list == null) {
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractMGSearch.java

    r9874 r9902  
    6565    protected static final String INDEX_ELEM = "index";
    6666
    67     /** the default index */
    68     protected String default_index = null;
    6967    /** the stem used for the index files */
    7068    protected String index_stem = null;
     
    9391    if (def != null) {
    9492        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
    10094
    10195    // the index stem is either the collection name or is specified in the config file
     
    148142    }
    149143
    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 -
    153146    Element index_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_ELEM+GSXML.LIST_MODIFIER);
    154147    NodeList indexes = index_list.getElementsByTagName(INDEX_ELEM);
     
    163156
    164157    }
    165 
    166158    /** do the actual query */
    167159    protected Element processTextQuery(Element request)
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java

    r9435 r9902  
    7171     */
    7272    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 = "";
    7378
    7479    public AbstractSearch()
     
    207212        param_type = GSXML.PARAM_TYPE_ENUM_MULTI;
    208213        }
    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);
    210215        param_list.appendChild(param);
    211216    } else if (name.equals(MAXDOCS_PARAM)) {
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/IViaSearch.java

    r9874 r9902  
    5151    does_paging = true;
    5252    does_multi_index_search = true;
     53    this.default_index = ",kw,au,su,ti,de,fu,"; // all of them
    5354    return super.configure(info, extra_info);
    5455    }
Note: See TracChangeset for help on using the changeset viewer.