Changeset 13927


Ignore:
Timestamp:
2007-02-19T10:55:25+13:00 (17 years ago)
Author:
kjdon
Message:

now uses a default index if no index param is specified for a query

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/LuceneSearch.java

    r13270 r13927  
    4040    protected static final String INDEX_ELEM = "index";
    4141   
     42    public boolean configure(Element info, Element extra_info) {
     43    if (!super.configure(info, extra_info)){
     44        return false;
     45    }
     46   
     47    default_index = "idx";
     48    return true;
     49    }
     50   
    4251    protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang)
    4352    {
     
    5665    } else {
    5766        // there is only one index, so we assume the default
    58         index_ids.add("idx");
     67        index_ids.add(this.default_index);
    5968        index_names.add("Default index");
    6069    }
     
    94103    // Get the index
    95104    String index = (String) params.get(INDEX_PARAM);
     105    if (index == null || index.equals("")) {
     106        index = this.default_index; // assume the default
     107    }
    96108        try {
    97109        String index_dir = GSFile.collectionIndexDir(this.site_home, this.cluster_name);
Note: See TracChangeset for help on using the changeset viewer.