Changeset 29543

Show
Ignore:
Timestamp:
08.12.2014 11:11:12 (4 years ago)
Author:
kjdon
Message:

I went to update the solr code with the new reverse sort param, and found that it uses asc/desc internally. Also you can do a comma separated list. So, I have moved the sort order param out of sharedsolenegs2fieldsearch and into lucenesearch and solrsearch so they can have different versions of it.

Files:
1 modified

Legend:

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

    r29541 r29543  
    4141  protected static final String SORT_ELEM = "sort"; 
    4242  protected static final String DEFAULT_SORT_ELEM = "defaultSort"; 
    43   protected static final String SORT_ORDER_PARAM = "reverseSort"; 
    44   protected static final String SORT_ORDER_REVERSE = "1"; 
    45   protected static final String SORT_ORDER_NORMAL = "0"; 
    4643 
    4744  static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.SharedSoleneGS2FieldSearch.class.getName()); 
     
    6259        does_paging = true; 
    6360        does_chunking = true; 
    64         paramDefaults.put(SORT_ORDER_PARAM, SORT_ORDER_NORMAL); 
    6561    } 
    6662 
     
    124120        /** Lucene's/Solr's rank (sort) param is based on sort fields, not ranked/not */ 
    125121        createParameter(RANK_PARAM, param_list, lang); 
    126         createParameter(SORT_ORDER_PARAM, param_list, lang); 
    127122    } 
    128123  /** add in Lucene/SOLR specific params for AdvancedFieldQuery */ 
     
    131126        super.addCustomQueryParamsAdvField(param_list, lang); 
    132127        createParameter(RANK_PARAM, param_list, lang); 
    133         createParameter(SORT_ORDER_PARAM, param_list, lang); 
    134128         
    135129    } 
     
    162156            param = GSXML.createParameterDescription2(doc, name, getTextString("param." + name, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, param_default, fields, field_names); 
    163157             
    164         } else if (name.equals(SORT_ORDER_PARAM)) { 
    165         String[] vals = { SORT_ORDER_REVERSE, SORT_ORDER_NORMAL }; 
    166         String[] vals_texts = { getTextString("param." + SORT_ORDER_PARAM + "." + SORT_ORDER_REVERSE, lang), getTextString("param." + SORT_ORDER_PARAM + "." + SORT_ORDER_NORMAL, lang) }; 
    167  
    168         param = GSXML.createParameterDescription(doc, SORT_ORDER_PARAM, getTextString("param." + SORT_ORDER_PARAM, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, param_default, vals, vals_texts); 
    169       } 
     158        }  
    170159 
    171160        if (param != null)