Package org.apache.solr.search.facet
Class FacetRequest
java.lang.Object
org.apache.solr.search.facet.FacetRequest
- Direct Known Subclasses:
FacetField,FacetHeatmap,FacetQuery,FacetRange
A request to do facets/stats that might itself be composed of sub-FacetRequests. This is a
cornerstone of the facet module.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classSimple structure for encapsulating a sort variable and a directionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FacetRequest.Domainprotected Map<String, AggValueSource> protected booleanprotected Map<String, FacetRequest> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStat(String key, AggValueSource stat) voidaddSubFacet(String key, FacetRequest facetRequest) booleanReturns true if this facet, or any sub-facets can produce results from an empty domain.abstract FacetMergercreateFacetMerger(Object prototype) abstract FacetProcessor<? extends FacetRequest> createFacetProcessor(FacetContext fcontext) booleandoRefine()Returns null if unsetstatic FacetRequestparse(SolrQueryRequest req, Map<String, Object> params) Factory method to parse a facet request tree.static FacetRequestparseOneFacetReq(SolrQueryRequest req, Map<String, Object> params) Factory method to parse out a rooted facet request tree that would normally go one level below a label.final Objectprocess(SolrQueryRequest req, DocSet domain) Process this facet request against the given domain of docs.booleanReturns true if this facet can return just some of the facet buckets that match all the criteria.toString()
-
Field Details
-
facetStats
-
subFacets
-
processEmpty
protected boolean processEmpty -
domain
-
-
Constructor Details
-
FacetRequest
public FacetRequest()
-
-
Method Details
-
parse
Factory method to parse a facet request tree. The outer keys are arbitrary labels and their values are facet request specifications. Will throw aSolrExceptionif it fails to parse.- Parameters:
req- the overall requestparams- a typed parameter structure (unlike SolrParams which are all string values).
-
parseOneFacetReq
Factory method to parse out a rooted facet request tree that would normally go one level below a label. The params must contain a "type". This is intended to be useful externally, such as bySimpleFacets.- Parameters:
req- the overall requestparams- a typed parameter structure (unlike SolrParams which are all string values).
-
getFacetStats
-
getSubFacets
-
getRefineMethod
Returns null if unset -
doRefine
public boolean doRefine() -
returnsPartial
public boolean returnsPartial()Returns true if this facet can return just some of the facet buckets that match all the criteria. This is normally true only for facets with a limit. -
canProduceFromEmpty
public boolean canProduceFromEmpty()Returns true if this facet, or any sub-facets can produce results from an empty domain. -
addStat
-
addSubFacet
-
toString
-
process
Process this facet request against the given domain of docs. Note: this is currently used externally bySimpleFacets.- Throws:
IOException
-
createFacetProcessor
-
createFacetMerger
-
getFacetDescription
-