Example usage for org.apache.solr.client.solrj.response FacetField.Count toString

List of usage examples for org.apache.solr.client.solrj.response FacetField.Count toString

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj.response FacetField.Count toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:eu.europeana.portal2.web.presentation.model.submodel.impl.BriefBeanViewImpl.java

License:EUPL

private Map<String, String> createFacetLogs(List<FacetField> facetFieldList) {
    Map<String, String> facetLogs = new HashMap<String, String>();
    if (facetFieldList != null) {
        for (FacetField facetField : facetFieldList) {
            // only for LANGUAGE or COUNTRY field
            if (facetField.getName().equalsIgnoreCase("LANGUAGE")
                    || facetField.getName().equalsIgnoreCase("COUNTRY")) {
                List<FacetField.Count> list = facetField.getValues();
                if (list == null) {
                    break;
                }//from www.j  a v  a2 s  .  com
                List<String> counts = new ArrayList<String>();
                int counter = 0;
                for (FacetField.Count count : list) {
                    counter++;
                    counts.add(count.toString());
                    if (counter > 5) {
                        break;
                    }
                }
                facetLogs.put(facetField.getName(), StringUtils.join(counts, ","));
            }
        }
    }
    return facetLogs;
}