Changeset 38109 for gs3-extensions/solr


Ignore:
Timestamp:
2023-09-13T11:27:56+12:00 (8 months ago)
Author:
kjdon
Message:

getCounts no longer returns a HashMap, it has to return a List. so lets use ArrayList

File:
1 edited

Legend:

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

    r32085 r38109  
    2626package org.greenstone.gsdl3.util;
    2727
    28 import java.util.HashMap;
     28import java.util.ArrayList;
     29import java.util.List;
    2930
    3031import org.apache.solr.client.solrj.response.FacetField;
     
    3233public class SolrFacetWrapper extends FacetWrapper
    3334{
    34     protected HashMap<String, Long> _counts = new HashMap<String, Long>();
    35    
     35
     36    protected ArrayList<FacetWrapper.FacetCount> _counts = new ArrayList<FacetWrapper.FacetCount>();
    3637    public SolrFacetWrapper(FacetField facet)
    3738    {
     
    4041        for(FacetField.Count count : facet.getValues())
    4142        {
    42             _counts.put(count.getName(), count.getCount());
     43
     44            _counts.add(new FacetWrapper.FacetCount(count.getName(), count.getCount()));
    4345        }
    4446    }
    4547   
    46     public HashMap<String, Long> getCounts()
    47     {
    48         return _counts;
    49     }
     48
     49    public List<FacetWrapper.FacetCount> getCounts()
     50    {
     51    return _counts;
     52    }
    5053}
Note: See TracChangeset for help on using the changeset viewer.