Package org.apache.solr.analytics.facet
Class SortableFacet
- java.lang.Object
-
- org.apache.solr.analytics.facet.AnalyticsFacet
-
- org.apache.solr.analytics.facet.SortableFacet
-
- Direct Known Subclasses:
PivotNode
,ValueFacet
public abstract class SortableFacet extends AnalyticsFacet
A facet that can be sorted by either the facet value or an expression value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SortableFacet.FacetBucket
static class
SortableFacet.FacetSortSpecification
Specifies how to sort the buckets of a sortable facet.
-
Field Summary
Fields Modifier and Type Field Description protected SortableFacet.FacetSortSpecification
sort
-
Fields inherited from class org.apache.solr.analytics.facet.AnalyticsFacet
collectionManager, expressionCalculator, name, reductionData
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SortableFacet(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterable<SortableFacet.FacetBucket>
applyOptions(List<SortableFacet.FacetBucket> facetResults)
Apply the sorting options to the given facet results.org.apache.solr.common.util.NamedList<Object>
createOldResponse()
Create the old olap-style response of the facet to be returned in the overall analytics response.Iterable<Map<String,Object>>
createResponse()
Create the response of the facet to be returned in the overall analytics response.SortableFacet.FacetSortSpecification
getSort()
void
setSort(SortableFacet.FacetSortSpecification sort)
-
Methods inherited from class org.apache.solr.analytics.facet.AnalyticsFacet
exportFacetValue, exportShardData, getName, importFacetValue, importShardData, setExpressionCalculator, setReductionCollectionManager
-
-
-
-
Field Detail
-
sort
protected SortableFacet.FacetSortSpecification sort
-
-
Constructor Detail
-
SortableFacet
protected SortableFacet(String name)
-
-
Method Detail
-
createOldResponse
public org.apache.solr.common.util.NamedList<Object> createOldResponse()
Description copied from class:AnalyticsFacet
Create the old olap-style response of the facet to be returned in the overall analytics response.- Overrides:
createOldResponse
in classAnalyticsFacet
- Returns:
- the response of the facet
-
createResponse
public Iterable<Map<String,Object>> createResponse()
Description copied from class:AnalyticsFacet
Create the response of the facet to be returned in the overall analytics response.- Overrides:
createResponse
in classAnalyticsFacet
- Returns:
- the response of the facet
-
applyOptions
protected Iterable<SortableFacet.FacetBucket> applyOptions(List<SortableFacet.FacetBucket> facetResults)
Apply the sorting options to the given facet results.- Parameters:
facetResults
- to apply sorting options to- Returns:
- the sorted results
-
getSort
public SortableFacet.FacetSortSpecification getSort()
-
setSort
public void setSort(SortableFacet.FacetSortSpecification sort)
-
-