public static class FacetComponent.FacetContext extends Object
An instance of this class is initialized and kept in the request context via the static
method initContext(ResponseBuilder)
and
can be retrieved via getFacetContext(SolrQueryRequest)
This class is used exclusively in a single-node context (i.e. non distributed requests or an individual shard
request). Also see FacetComponent.FacetInfo
which is
dedicated exclusively for merging responses from multiple shards and plays no role during computation of facet
counts in a single node request.
This API is experimental and subject to change
FacetComponent.FacetInfo
Modifier and Type | Method and Description |
---|---|
List<FacetComponent.FacetBase> |
getAllQueryFacets() |
List<RangeFacetRequest> |
getAllRangeFacetRequests() |
static FacetComponent.FacetContext |
getFacetContext(SolrQueryRequest req)
Return the
FacetComponent.FacetContext instance
cached in the request context. |
List<FacetComponent.FacetBase> |
getQueryFacetsForTag(String tag) |
List<RangeFacetRequest> |
getRangeFacetRequestsForTag(String tag) |
static void |
initContext(ResponseBuilder rb)
Initializes FacetContext using request parameters and saves it in the request
context which can be retrieved via
getFacetContext(SolrQueryRequest) |
public static void initContext(ResponseBuilder rb)
getFacetContext(SolrQueryRequest)
rb
- the ResponseBuilder object from which the request parameters are read
and to which the FacetContext object is saved.public static FacetComponent.FacetContext getFacetContext(SolrQueryRequest req) throws IllegalStateException
FacetComponent.FacetContext
instance
cached in the request context.req
- the SolrQueryRequest
IllegalStateException
- if no cached FacetContext instance is found in the request contextpublic List<RangeFacetRequest> getAllRangeFacetRequests()
List
of RangeFacetRequest
objects each representing a facet.range to be
computed. Returns an empty list if no facet.range were requested.public List<FacetComponent.FacetBase> getAllQueryFacets()
List
of FacetComponent.FacetBase
objects
each representing a facet.query to be computed. Returns an empty list of no facet.query were requested.public List<RangeFacetRequest> getRangeFacetRequestsForTag(String tag)
tag
- a String tag usually specified via local param on a facet.pivotRangeFacetRequest
objects which have been tagged with the given tag.
Returns an empty list if none found.public List<FacetComponent.FacetBase> getQueryFacetsForTag(String tag)
tag
- a String tag usually specified via local param on a facet.pivotFacetComponent.FacetBase
objects which have been
tagged with the given tag. Returns and empty List if none found.Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.