Changeset 29541

Show
Ignore:
Timestamp:
08.12.2014 10:24:18 (5 years ago)
Author:
kjdon
Message:

changed sort order param to reverse sort param. matches better what lucene/solr actually do, and removes the issue of needing a different default sort order when sorting by rank vs other field.

Files:
1 modified

Legend:

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

    r29427 r29541  
    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 = "sortOrder"; 
    44   protected static final String SORT_ORDER_DESCENDING = "1"; 
    45   protected static final String SORT_ORDER_ASCENDING = "0"; 
     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"; 
    4646 
    4747  static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.SharedSoleneGS2FieldSearch.class.getName()); 
     
    6262        does_paging = true; 
    6363        does_chunking = true; 
    64         paramDefaults.put(SORT_ORDER_PARAM, SORT_ORDER_DESCENDING); 
     64        paramDefaults.put(SORT_ORDER_PARAM, SORT_ORDER_NORMAL); 
    6565    } 
    6666 
     
    163163             
    164164        } else if (name.equals(SORT_ORDER_PARAM)) { 
    165         String[] vals = { SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING }; 
    166         String[] vals_texts = { getTextString("param." + SORT_ORDER_PARAM + "." + SORT_ORDER_ASCENDING, lang), getTextString("param." + SORT_ORDER_PARAM + "." + SORT_ORDER_DESCENDING, lang) }; 
     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) }; 
    167167 
    168168        param = GSXML.createParameterDescription(doc, SORT_ORDER_PARAM, getTextString("param." + SORT_ORDER_PARAM, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, param_default, vals, vals_texts);