Changeset 24394

Show
Ignore:
Timestamp:
12.08.2011 16:23:31 (8 years ago)
Author:
davidb
Message:

Through the audioDB extension we now support a form of content-based audio/music searching. These commited changes reflect this generalization in our Service inheritance hierarchy for searching. Basically, what used to be thought of as a search service implied a *text* search service.

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service
Files:
2 added
1 removed
8 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java

    r21655 r24394  
    4040 
    4141abstract public class AbstractGS2FieldSearch  
    42     extends AbstractGS2Search  
     42    extends AbstractGS2TextSearch  
    4343{ 
    4444 
     
    159159      }  
    160160       
    161       // AbstractGS2Search has set up the text query service, but we may not want it 
     161      // AbstractGS2TextSearch has set up the TextQuery service, but we may not want it 
    162162      if (!this.plain_search) { 
    163163        // need to remove the TextQuery service 
    164         Element tq_service = GSXML.getNamedElement(short_service_info, GSXML.SERVICE_ELEM, GSXML.NAME_ATT, TEXT_QUERY_SERVICE); 
     164        Element tq_service = GSXML.getNamedElement(short_service_info, GSXML.SERVICE_ELEM, GSXML.NAME_ATT, QUERY_SERVICE); 
    165165        short_service_info.removeChild(tq_service); 
    166166         
     
    200200     
    201201    // the format info is the same for all services 
    202     Element format_info = (Element)format_info_map.get(TEXT_QUERY_SERVICE); 
     202    Element format_info = (Element)format_info_map.get(QUERY_SERVICE); 
    203203     
    204204    // set up the extra services which are available for this collection 
     
    349349    } else if (name.equals(FIELD_CASE_PARAM) || name.equals(FIELD_STEM_PARAM) || name.equals(FIELD_ACCENT_PARAM)) { 
    350350        String[] bool_ops = {"0", "1"}; 
    351         String[] bool_texts = {getTextString("param.boolean.off", lang, "AbstractSearch"),getTextString("param.boolean.on", lang, "AbstractSearch")};  
     351        String[] bool_texts = {getTextString("param.boolean.off", lang, "AbstractTextSearch"),getTextString("param.boolean.on", lang, "AbstractTextSearch")};  
    352352        param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_BOOLEAN, BOOLEAN_PARAM_ON, bool_ops, bool_texts); 
    353353         
     
    430430    protected Element processAnyQuery(Element request, int query_type) 
    431431    { 
    432  
    433432    String service_name=null; 
    434433    String empty_query_test_param=null; 
     
    436435    switch (query_type) { 
    437436    case TEXT_QUERY: 
    438         service_name = TEXT_QUERY_SERVICE;  
     437        service_name = QUERY_SERVICE;  
    439438        empty_query_test_param = QUERY_PARAM; 
    440439        break; 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java

    r20240 r24394  
    2222import org.greenstone.gsdl3.util.GSXML; 
    2323import org.greenstone.gsdl3.util.GSPath; 
     24import org.greenstone.gsdl3.util.AbstractSimpleDocument; 
     25import org.greenstone.gsdl3.util.SimpleDocument; 
    2426 
    2527// XML classes 
     
    4345{ 
    4446 
    45    static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.AbstractSearch.class.getName()); 
    46  
    47      
     47    static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.AbstractSearch.class.getName()); 
     48 
    4849    // the search service 
    49     protected static final String TEXT_QUERY_SERVICE = "TextQuery"; 
    50  
     50    protected String QUERY_SERVICE = null; // set by subclass  
     51     
    5152    // compulsory params 
    5253    protected static final String INDEX_PARAM = "index"; 
     
    5455 
    5556    // optional standard params - some of these have to be implemented 
    56     protected static final String INDEX_SUBCOLLECTION_PARAM = "indexSubcollection"; 
    57     protected static final String INDEX_LANGUAGE_PARAM = "indexLanguage"; 
    5857    protected static final String MAXDOCS_PARAM = "maxDocs"; 
    5958    protected static final String HITS_PER_PAGE_PARAM = "hitsPerPage"; 
    6059    protected static final String START_PAGE_PARAM = "startPage"; 
    6160 
    62     protected static final String INDEX_SUBCOLLECTION_ELEM = "indexSubcollection"; 
    63     protected static final String INDEX_LANGUAGE_ELEM = "indexLanguage"; 
    64     
    65  
    66     // some other common params that may be used 
    67     protected static final String CASE_PARAM = "case"; 
    68     protected static final String STEM_PARAM = "stem"; 
    69     protected static final String ACCENT_PARAM="accent"; 
    70  
    71     protected static final String BOOLEAN_PARAM_ON = "1"; 
    72     protected static final String BOOLEAN_PARAM_OFF = "0"; 
    73     protected static final String MATCH_PARAM = "matchMode"; 
    74     protected static final String MATCH_PARAM_ALL = "all"; 
    75     protected static final String MATCH_PARAM_SOME = "some"; 
    76  
    77     /** can more than one index be searched at the smae time? */ 
     61    protected AbstractSimpleDocument gs_doc = null; 
     62 
     63    /** can more than one index be searched at the same time? */ 
    7864    protected boolean does_multi_index_search = false; 
    7965    /** does this service support paging of results? */ 
     
    9076    protected String default_index = ""; 
    9177 
    92     protected String default_index_subcollection = ""; 
    93  
    94     protected String default_index_language = ""; 
    95     
    9678    protected String default_max_docs = "100"; 
    9779     
     
    10284    } 
    10385 
    104     /** sets up the short service info for TextQuery. If other services  
    105      * will be provided, should be added in the subclass configure 
    106      * also looks for search format info, and document format info 
     86    /** Sets up the short service info for service by QUERY_SERVICE  
     87     *    (e.g. TextQuery or AudioQuery) 
     88     *  If other services will be provided, should be added in the 
     89     *  subclass configure also looks for search format info, and 
     90     *  document format info 
    10791     */ 
    10892    public boolean configure(Element info, Element extra_info) 
     
    116100    this.config_info = info; 
    117101 
    118     // set up short_service_info_ - for now just has id and type. the name (lang dependent) will be added in if the list is requested. 
     102    // set up short_service_info_  
     103    // => for now just has id and type. the name (lang dependent) 
     104    //    will be added in if the list is requested. 
     105 
    119106    Element tq_service = this.doc.createElement(GSXML.SERVICE_ELEM); 
    120107    tq_service.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_QUERY); 
    121     tq_service.setAttribute(GSXML.NAME_ATT, TEXT_QUERY_SERVICE); 
     108    tq_service.setAttribute(GSXML.NAME_ATT, QUERY_SERVICE); 
    122109    this.short_service_info.appendChild(tq_service); 
    123110 
    124     // add some format info to service map if there is any - look in extra info 
    125     // first look in buildConfig 
     111    // add some format info to service map if there is any  
     112    // => lookin extra info first look in buildConfig 
     113 
    126114    Element format = (Element)GSXML.getChildByTagName(info, GSXML.FORMAT_ELEM); 
    127115 
     
    129117        String path = GSPath.appendLink(GSXML.SEARCH_ELEM, GSXML.FORMAT_ELEM); 
    130118 
    131       //note by xiao: instead of retrieving the first 'format' element inside the 'search' 
    132       // element, we are trying to find the real format element which has at least one 
    133       // 'gsf:template' child element. (extra_info is collectionConfig.xml) 
    134       //format = (Element) GSXML.getNodeByPath(extra_info, path); 
    135       Element search_elem = (Element) GSXML.getChildByTagName(extra_info, GSXML.SEARCH_ELEM); 
    136       NodeList format_elems = null; 
    137       if (search_elem != null) { 
    138         format_elems = search_elem.getElementsByTagName(GSXML.FORMAT_ELEM); 
    139       } 
    140       for(int i=0; i<format_elems.getLength(); i++) { 
    141           format = (Element)format_elems.item(i); 
    142           if (format.getElementsByTagName("gsf:template").getLength() != 0) { 
    143             break; 
    144           } 
    145       } 
     119        // Note by xiao: instead of retrieving the first 'format' 
     120        //   element inside the 'search' element, we are trying to 
     121        //   find the real format element which has at least one 
     122        //   'gsf:template' child element. (extra_info is 
     123        //   collectionConfig.xml) 
     124 
     125        //format = (Element) GSXML.getNodeByPath(extra_info, path); 
     126       
     127        Element search_elem = (Element) GSXML.getChildByTagName(extra_info, GSXML.SEARCH_ELEM); 
     128        NodeList format_elems = null; 
     129        if (search_elem != null) { 
     130        format_elems = search_elem.getElementsByTagName(GSXML.FORMAT_ELEM); 
     131        } 
     132        for(int i=0; i<format_elems.getLength(); i++) { 
     133        format = (Element)format_elems.item(i); 
     134        if (format.getElementsByTagName("gsf:template").getLength() != 0) { 
     135            break; 
     136        } 
     137        } 
    146138    }//end of if(format==null) 
    147139    // 
    148140    if (format != null) { 
    149         this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(format, true)); 
     141        this.format_info_map.put(QUERY_SERVICE, this.doc.importNode(format, true)); 
    150142    } 
    151143     
     
    164156    } 
    165157 
     158    // Base line for document (might be overriden by sub-classes) 
     159    gs_doc = new SimpleDocument(this.doc,this.default_document_type); 
     160 
    166161    return true; 
    167162    } 
    168163     
    169     /** returns the description of the TextQuery service. If a subclass  
    170      * provides other services they need to provides their own descriptions */ 
     164    /** returns a basic description for QUERY_SERVICE. If a subclass  
     165     * provides other services they need to provide their own descriptions */ 
    171166    protected Element getServiceDescription(String service, String lang, String subset)  
    172167    { 
    173     if (!service.equals(TEXT_QUERY_SERVICE)) { 
     168    if (!service.equals(QUERY_SERVICE)) { 
    174169        return null; 
    175170    } 
     
    177172    Element tq_service = this.doc.createElement(GSXML.SERVICE_ELEM); 
    178173    tq_service.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_QUERY); 
    179     tq_service.setAttribute(GSXML.NAME_ATT, TEXT_QUERY_SERVICE); 
     174    tq_service.setAttribute(GSXML.NAME_ATT, QUERY_SERVICE); 
    180175    if (subset==null || subset.equals(GSXML.DISPLAY_TEXT_ELEM+GSXML.LIST_MODIFIER)) { 
    181         tq_service.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_NAME, getServiceName(TEXT_QUERY_SERVICE, lang) )); 
    182         tq_service.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_SUBMIT, getServiceSubmit(TEXT_QUERY_SERVICE, lang) )); 
    183         tq_service.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_DESCRIPTION, getServiceDescription(TEXT_QUERY_SERVICE, lang))); 
     176        tq_service.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_NAME, getServiceName(QUERY_SERVICE, lang) )); 
     177        tq_service.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_SUBMIT, getServiceSubmit(QUERY_SERVICE, lang) )); 
     178        tq_service.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_DESCRIPTION, getServiceDescription(QUERY_SERVICE, lang))); 
    184179    } 
    185180    if (subset==null || subset.equals(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER)) { 
     
    219214        createParameter(INDEX_PARAM, param_list, lang); 
    220215    } 
    221     if (!default_index_subcollection.equals("")){ 
    222         createParameter(INDEX_SUBCOLLECTION_PARAM,param_list, lang); 
    223     } 
    224     if (!default_index_language.equals("")){ 
    225         createParameter(INDEX_LANGUAGE_PARAM,param_list, lang);  
    226     } 
    227216    if (does_chunking) { 
    228217        createParameter(MAXDOCS_PARAM, param_list, lang); 
     
    243232    // default behaviour, do nothing 
    244233    } 
    245  
    246     protected void createParameter(String name, Element param_list, String lang) { 
    247       createParameter(name, param_list, lang, null); 
    248     } 
    249     /** default implementations for the standard parameters plus some  
    250      * other common ones  
    251      * index, maxDocs, hitsPerPage, startPage, query, case, stem,  
     234     
     235    protected void createParameter(String name, Element param_list, String lang)  
     236    { 
     237    createParameter(name, param_list, lang, null); 
     238    } 
     239 
     240     protected void createParameter(String name, Element param_list, String lang, String default_value)  
     241    { 
     242    // at this level, not interested in boolean return type 
     243    createParameterChain(name,param_list,lang,default_value); 
     244    } 
     245 
     246 
     247    /** default implementations for the standard parameters plus some 
     248     * other common ones index, maxDocs, hitsPerPage, startPage 
    252249    */ 
    253      protected void createParameter(String name, Element param_list, String lang, String default_value) { 
     250 
     251     protected boolean createParameterChain(String name, Element param_list, String lang, String default_value)  
     252    { 
    254253    Element param = null; 
    255254    String param_default = default_value; 
     255 
    256256    if (name.equals(QUERY_PARAM)) { 
    257257        param = GSXML.createParameterDescription(this.doc, QUERY_PARAM, getTextString("param."+QUERY_PARAM, lang), GSXML.PARAM_TYPE_STRING, param_default, null, null); 
    258258        param_list.appendChild(param); 
     259        return true; 
    259260    } else if (name.equals(INDEX_PARAM)) { 
    260261 
     
    272273        param = GSXML.createParameterDescription2(this.doc, INDEX_PARAM, getTextString("param."+INDEX_PARAM, lang), param_type, param_default, index_ids, index_names); 
    273274        param_list.appendChild(param); 
    274     } 
    275         else if (name.equals(INDEX_SUBCOLLECTION_PARAM)){ 
    276         Element index_sub_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_SUBCOLLECTION_ELEM+GSXML.LIST_MODIFIER); 
    277          if (index_sub_list == null) return; 
    278          ArrayList index_sub_ids = new ArrayList(); 
    279          ArrayList index_sub_names = new ArrayList(); 
    280         getIndexSubcollectionData(index_sub_ids, index_sub_names, lang); 
    281         String param_type = GSXML.PARAM_TYPE_ENUM_SINGLE; 
    282         if (does_multi_index_search) { 
    283         param_type = GSXML.PARAM_TYPE_ENUM_MULTI; 
    284         } 
     275        return true; 
     276    } 
     277        else if (name.equals(MAXDOCS_PARAM)) { 
    285278        if (param_default == null) { 
    286           param_default = this.default_index_subcollection; 
    287         } 
    288         param = GSXML.createParameterDescription2(this.doc, INDEX_SUBCOLLECTION_PARAM, getTextString("param."+INDEX_SUBCOLLECTION_PARAM, lang), param_type, param_default, index_sub_ids, index_sub_names); 
    289         param_list.appendChild(param); 
    290     } 
    291     else if(name.equals(INDEX_LANGUAGE_PARAM)){ 
    292         Element index_lang_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_LANGUAGE_ELEM+GSXML.LIST_MODIFIER); 
    293             if (index_lang_list == null) return;  
    294         ArrayList index_lang_ids = new ArrayList(); 
    295         ArrayList index_lang_names = new ArrayList(); 
    296         getIndexLanguageData(index_lang_ids, index_lang_names, lang); 
    297         String param_type = GSXML.PARAM_TYPE_ENUM_SINGLE; 
    298         if (does_multi_index_search) { 
    299         param_type = GSXML.PARAM_TYPE_ENUM_MULTI; 
    300         } 
     279        param_default = this.default_max_docs; 
     280        } 
     281       
     282        param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, param_default, null, null); 
     283        param_list.appendChild(param); 
     284        return true; 
     285    } 
     286    else if(name.equals(HITS_PER_PAGE_PARAM)){ 
    301287        if (param_default == null) { 
    302           param_default = this.default_index_language; 
    303         } 
    304         param = GSXML.createParameterDescription2(this.doc, INDEX_LANGUAGE_PARAM, getTextString("param."+INDEX_LANGUAGE_PARAM, lang), param_type, param_default, index_lang_ids, index_lang_names); 
    305         param_list.appendChild(param); 
    306     } 
    307         else if (name.equals(MAXDOCS_PARAM)) { 
    308       if (param_default == null) { 
    309         param_default = this.default_max_docs; 
    310       } 
    311  
     288        param_default = this.default_hits_per_page; 
     289        } 
     290       
    312291        param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, param_default, null, null); 
    313292        param_list.appendChild(param); 
    314     } 
    315     else if(name.equals(HITS_PER_PAGE_PARAM)){ 
    316       if (param_default == null) { 
    317         param_default = this.default_hits_per_page; 
    318       } 
    319        
    320          param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, param_default, null, null); 
    321         param_list.appendChild(param); 
    322     } 
    323     else if (name.equals(CASE_PARAM) || name.equals(STEM_PARAM) || name.equals(ACCENT_PARAM)) { 
    324       if (param_default == null) { 
    325         param_default = BOOLEAN_PARAM_OFF; 
    326       } 
    327         String[] bool_ops = {"0", "1"}; 
    328         String[] bool_texts = {getTextString("param.boolean.off", lang),getTextString("param.boolean.on", lang)};  
    329         param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_BOOLEAN, param_default, bool_ops, bool_texts); 
    330         param_list.appendChild(param); 
    331     } else if (name.equals(MATCH_PARAM)) { 
    332       if (param_default == null) { 
    333         param_default = MATCH_PARAM_SOME; 
    334       } 
    335        
    336         String[] vals = {MATCH_PARAM_SOME, MATCH_PARAM_ALL }; 
    337         String[] val_texts = {getTextString("param."+MATCH_PARAM+"."+MATCH_PARAM_SOME, lang), getTextString("param."+MATCH_PARAM+"."+MATCH_PARAM_ALL, lang)};  
    338         param = GSXML.createParameterDescription(this.doc, MATCH_PARAM, getTextString("param."+MATCH_PARAM, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, param_default, vals, val_texts); 
    339         param_list.appendChild(param); 
     293        return true; 
    340294    } else if (name.equals(START_PAGE_PARAM)) { 
    341       if (param_default == null) { 
    342         param_default = "1"; 
    343       } 
    344        
     295        if (param_default == null) { 
     296        param_default = "1"; 
     297        } 
     298         
    345299        // start page - set to 1 for the search page 
    346300        param = GSXML.createParameterDescription(this.doc, START_PAGE_PARAM, "", GSXML.PARAM_TYPE_INVISIBLE, param_default, null, null); 
    347301        param_list.appendChild(param); 
    348     } 
    349          
    350          
    351     } 
     302        return true; 
     303    } 
     304 
     305    // Get to there then none of the above params matched 
     306    // => return false so the chain can continue 
     307    return false; 
     308    } 
     309 
     310 
    352311    /** create an element to go into the search results list. A node element 
    353312     * has the form 
    354313     * <docNode nodeId='xxx' nodeType='leaf' docType='hierarchy' rank='0.23'/> 
    355314     */ 
    356     protected Element createDocNode(String node_id, String rank) { 
    357     Element node = this.doc.createElement(GSXML.DOC_NODE_ELEM); 
    358     node.setAttribute(GSXML.NODE_ID_ATT, node_id); 
    359     node.setAttribute(GSXML.NODE_RANK_ATT, rank); 
    360     String doc_type = null; 
    361     if (default_document_type != null) { 
    362         doc_type = default_document_type; 
    363     } else { 
    364         doc_type = getDocType(node_id); 
    365     } 
    366     node.setAttribute(GSXML.DOC_TYPE_ATT, doc_type); 
    367     String node_type = getNodeType(node_id, doc_type);   
    368     node.setAttribute(GSXML.NODE_TYPE_ATT, node_type); 
    369     return node; 
     315    protected Element createDocNode(String node_id, String rank)  
     316    { 
     317    return this.gs_doc.createDocNode(node_id,rank); 
     318    } 
     319 
     320    /** returns the document type of the doc that the specified node  
     321    belongs to. should be one of  
     322    GSXML.DOC_TYPE_SIMPLE,  
     323    GSXML.DOC_TYPE_PAGED,  
     324    GSXML.DOC_TYPE_HIERARCHY 
     325    */ 
     326    protected String getDocType(String node_id){ 
     327    return this.gs_doc.getDocType(node_id); 
    370328    } 
    371329 
     
    376334    GSXML.NODE_TYPE_ROOT 
    377335    */ 
    378     protected String getNodeType(String node_id, String doc_type) { 
    379     if (doc_type.equals(GSXML.DOC_TYPE_SIMPLE)) { 
    380         return GSXML.NODE_TYPE_LEAF; 
    381     } 
    382  
    383     if (!hasParent(node_id)) { 
    384         return GSXML.NODE_TYPE_ROOT; 
    385     } 
    386     if (doc_type.equals(GSXML.DOC_TYPE_PAGED)) { 
    387          return GSXML.NODE_TYPE_LEAF; 
    388     } 
    389     if (!hasChildren(node_id)) { 
    390         return GSXML.NODE_TYPE_LEAF; 
    391     } 
    392     return GSXML.NODE_TYPE_INTERNAL;     
    393      
    394     } 
    395  
    396  
    397     /** returns the document type of the doc that the specified node  
    398     belongs to. should be one of  
    399     GSXML.DOC_TYPE_SIMPLE,  
    400     GSXML.DOC_TYPE_PAGED,  
    401     GSXML.DOC_TYPE_HIERARCHY 
    402     default implementation returns GSXML.DOC_TYPE_SIMPLE, over ride  
    403     if documents can be hierarchical 
    404     */ 
    405     protected String getDocType(String node_id) { 
    406     return GSXML.DOC_TYPE_SIMPLE; 
    407     } 
    408      
    409     /** returns true if the node has child nodes  
    410      * default implementation returns false, over ride if documents can be  
    411      * hierarchical  
    412      */ 
    413     protected boolean hasChildren(String node_id) { 
    414     return false; 
    415     } 
    416     /** returns true if the node has a parent  
    417      * default implementation returns false, over ride if documents can be  
    418      * hierarchical*/ 
    419     protected boolean hasParent(String node_id) { 
    420     return false; 
    421     } 
    422  
    423     /** do the actual query  
    424      * must be implemented by subclass */ 
    425     abstract protected Element processTextQuery(Element request);  
    426      
     336    protected String getNodeType(String node_id, String doc_type)  
     337    { 
     338    return this.gs_doc.getNodeType(node_id,doc_type); 
     339    } 
     340     
     341    /** returns true if the node has child nodes */ 
     342    protected boolean hasChildren(String node_id) 
     343    { 
     344    return this.gs_doc.hasChildren(node_id); 
     345    } 
     346     
     347    /** returns true if the node has a parent */ 
     348    protected boolean hasParent(String node_id) 
     349    { 
     350    return this.gs_doc.hasParent(node_id); 
     351    } 
     352 
     353 
    427354    /** get the details about the indexes available 
    428355     * must be implemented by subclass 
     
    430357    abstract protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang); 
    431358 
    432     /** get the details about the indexexSubcollections available 
    433      * might be implemented by subclass 
    434      */ 
    435     protected void getIndexSubcollectionData(ArrayList index_ids, ArrayList index_names, String lang){} 
    436      
    437     /** get the details about the indexes available 
    438      * might be implemented by subclass 
    439      */ 
    440     protected void getIndexLanguageData(ArrayList index_ids, ArrayList index_names, String lang){} 
    441    
    442  
    443359} 
    444360 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java

    r16943 r24394  
    270270        Element service_list = (Element)GSXML.getChildByTagName(coll, GSXML.SERVICE_ELEM+GSXML.LIST_MODIFIER); 
    271271        if (service_list==null) continue; 
    272         Element query_service = GSXML.getNamedElement(service_list, GSXML.SERVICE_ELEM, GSXML.NAME_ATT, TEXT_QUERY_SERVICE); // should be AbstractSearch.TEXT_QUERY_SERVICE 
     272        Element query_service = GSXML.getNamedElement(service_list, GSXML.SERVICE_ELEM, GSXML.NAME_ATT, TEXT_QUERY_SERVICE); // should be AbstractTextSearch.TEXT_QUERY_SERVICE 
    273273        if (query_service == null) continue; 
    274274        // use the name of the response in case we are talking to a remote collection, not the name of the collection. 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java

    r20296 r24394  
    4646 
    4747public class GS2MGSearch 
    48 extends AbstractGS2Search { 
     48extends AbstractGS2TextSearch { 
    4949     
    5050    protected static MGSearchWrapper mg_src = null; 
     
    8181        // Create a new (empty) result message ('doc' is in ServiceRack.java) 
    8282        Element result = this.doc.createElement (GSXML.RESPONSE_ELEM); 
    83         result.setAttribute (GSXML.FROM_ATT, TEXT_QUERY_SERVICE); 
     83        result.setAttribute (GSXML.FROM_ATT, QUERY_SERVICE); 
    8484        result.setAttribute (GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 
    8585         
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java

    r15326 r24394  
    6969          String num = Long.toString((((MGPPDocInfo) docs.elementAt(d)).num_)); 
    7070          String doc_id = internalNum2OID(num); 
    71           DBInfo dbInfo = this.coll_db.getInfo(doc_id); 
     71          DBInfo dbInfo = this.gs_doc_db.getInfo(doc_id); 
    7272          String fre = (String)dbInfo.getInfo("Frequency"); 
    7373          String tense = (String)dbInfo.getInfo("Tense"); 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaSearch.java

    r22085 r24394  
    2626 
    2727public class IViaSearch 
    28     extends AbstractSearch { 
     28    extends AbstractTextSearch { 
    2929     
    3030 
     
    7777    // Create a new (empty) result message 
    7878    Element result = this.doc.createElement(GSXML.RESPONSE_ELEM); 
    79     result.setAttribute(GSXML.FROM_ATT, TEXT_QUERY_SERVICE); 
     79    result.setAttribute(GSXML.FROM_ATT, QUERY_SERVICE); 
    8080    result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 
    8181    Element doc_node_list = this.doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER); 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/LuceneSearch.java

    r20295 r24394  
    3232 
    3333public class LuceneSearch  
    34     extends AbstractSearch { 
     34    extends AbstractTextSearch { 
    3535 
    3636     static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.LuceneSearch.class.getName()); 
     
    7474    // Create a new (empty) result message 
    7575    Element result = this.doc.createElement(GSXML.RESPONSE_ELEM); 
    76     result.setAttribute(GSXML.FROM_ATT, TEXT_QUERY_SERVICE); 
     76    result.setAttribute(GSXML.FROM_ATT, QUERY_SERVICE); 
    7777    result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 
    7878    Element doc_node_list = this.doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER); 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/MapSearch.java

    r13270 r24394  
    5050 */ 
    5151public class MapSearch  
    52     extends AbstractSearch { 
     52    extends AbstractTextSearch { 
    5353 
    5454 
     
    163163    // Create a new (empty) result message 
    164164    Element result = doc.createElement(GSXML.RESPONSE_ELEM); 
    165     result.setAttribute(GSXML.FROM_ATT, TEXT_QUERY_SERVICE); 
     165    result.setAttribute(GSXML.FROM_ATT, QUERY_SERVICE); 
    166166    result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 
    167167