Changeset 28065


Ignore:
Timestamp:
2013-08-15T14:53:57+12:00 (11 years ago)
Author:
kjdon
Message:

adding in sort by none, and sort order asc/desc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java

    r27872 r28065  
    121121       
    122122        // 2. Setting up facets
     123        // TODO - get these from build config, in case some haven't built
    123124        Element searchElem = (Element) GSXML.getChildByTagName(extra_info, GSXML.SEARCH_ELEM);
    124125        NodeList facet_list = info.getElementsByTagName("facet");
     
    199200            }
    200201        }
    201 
     202       
    202203        // 3. if there are no more solr cores in Greenstone, then all_solr_cores will be empty, null the CoreContainer
    203204        // All going well, this will happen when we're ant stopping the Greenstone server and the last Solr collection
    204205        // is being deactivated
    205 
    206206        if (all_solr_cores!=null) {
    207207            Collection<String> coreNamesRemaining = all_solr_cores.getCoreNames();
     
    274274            else if (name.equals(RANK_PARAM))
    275275            {
    276                 if (value.equals(RANK_PARAM_RANK_VALUE))
    277                 {
    278                     value = null;
    279                 }
     276                if (value.equals(RANK_PARAM_RANK))
     277                {
     278                  value = SolrQueryWrapper.SORT_BY_RANK;
     279                } else if (value.equals(RANK_PARAM_NONE)) {
     280                    value = SolrQueryWrapper.SORT_BY_INDEX_ORDER;
     281                  }
     282               
    280283                this.solr_src.setSortField(value);
    281284            }
     285            else if (name.equals(SORT_ORDER_PARAM)) {
     286                if (value.equals(SORT_ORDER_DESCENDING)) {
     287                  this.solr_src.setSortOrder(SolrQueryWrapper.SORT_DESCENDING);
     288                } else {
     289                  this.solr_src.setSortOrder(SolrQueryWrapper.SORT_ASCENDING);
     290                }
     291              }
    282292            else if (name.equals(LEVEL_PARAM))
    283293            {
     
    291301                }
    292302            }
     303            // Would facets ever come in through params???
    293304            else if (name.equals("facets") && value.length() > 0)
    294305            {
     
    459470        {
    460471          SolrFacetWrapper wrap = new SolrFacetWrapper(facet);
    461           String name = wrap.getName();
    462           String display_name = "Poo";
    463           //wrap.setDisplayName(display_name);
     472          // String name = wrap.getName();
     473          // String display_name = "Poo";
     474          // wrap.setDisplayName(display_name);
    464475           
    465476          newFacetList.add(wrap);
Note: See TracChangeset for help on using the changeset viewer.