|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.facet.search.FacetRequest
public abstract class FacetRequest
Defines an aggregation request for a category. Allows specifying the
number of child categories
to return as well as
which
categories to consider the "top" (highest or
lowest ranking ones).
If the category being aggregated is hierarchical, you can also specify the
depth
up which to aggregate child categories as well
as how the result should be constructed
.
Nested Class Summary | |
---|---|
static class |
FacetRequest.ResultMode
When getDepth() is greater than 1, defines the
structure of the result as well as how constraints such as
numResults and getNumLabel() are
applied. |
static class |
FacetRequest.SortOrder
Defines which categories to return. |
Field Summary | |
---|---|
CategoryPath |
categoryPath
The category being aggregated in this facet request. |
int |
numResults
The number of child categories to return for categoryPath . |
Constructor Summary | |
---|---|
FacetRequest(CategoryPath path,
int numResults)
Constructor with the given category to aggregate and the number of child categories to return. |
Method Summary | |
---|---|
abstract FacetsAggregator |
createFacetsAggregator(FacetIndexingParams fip)
Returns the FacetsAggregator which can aggregate the categories of
this facet request. |
boolean |
equals(Object o)
|
int |
getDepth()
How deeply to look under categoryPath . |
int |
getNumLabel()
Allows to specify the number of categories to label. |
FacetRequest.ResultMode |
getResultMode()
Return the requested result mode (defaults to FacetRequest.ResultMode.PER_NODE_IN_TREE . |
FacetRequest.SortOrder |
getSortOrder()
Return the requested order of results (defaults to FacetRequest.SortOrder.DESCENDING . |
int |
hashCode()
|
void |
setDepth(int depth)
Sets the depth up to which to aggregate facets. |
void |
setNumLabel(int numLabel)
Sets the number of categories to label. |
void |
setResultMode(FacetRequest.ResultMode resultMode)
Sets the FacetRequest.ResultMode for this request. |
void |
setSortOrder(FacetRequest.SortOrder sortOrder)
Sets the FacetRequest.SortOrder for this request. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final CategoryPath categoryPath
public final int numResults
categoryPath
.
Constructor Detail |
---|
public FacetRequest(CategoryPath path, int numResults)
path
- the category to aggregate. Cannot be null
.numResults
- the number of child categories to return. If set to
Integer.MAX_VALUE
, all immediate child categories will be
returned. Must be greater than 0.Method Detail |
---|
public abstract FacetsAggregator createFacetsAggregator(FacetIndexingParams fip)
FacetsAggregator
which can aggregate the categories of
this facet request. The aggregator is expected to aggregate category values
into FacetArrays
. If the facet request does not support that, e.g.
RangeFacetRequest
, it can return null
. Note though that
such requests require a dedicated FacetsAccumulator
.
public boolean equals(Object o)
equals
in class Object
public final int getDepth()
categoryPath
. By default, only its
immediate children are aggregated (depth=1). If set to
Integer.MAX_VALUE
, the entire sub-tree of the category will be
aggregated.
NOTE: setting depth to 0 means that only the category itself should
be aggregated. In that case, make sure to index the category with
CategoryListParams.OrdinalPolicy.ALL_PARENTS
, unless it is not the root category (the
dimension), in which case CategoryListParams.OrdinalPolicy.ALL_BUT_DIMENSION
is fine
too.
public final int getNumLabel()
This allows an app to request a large number of results to return, while labeling them on-demand (e.g. when the UI requests to show more categories).
public final FacetRequest.ResultMode getResultMode()
FacetRequest.ResultMode.PER_NODE_IN_TREE
.
public final FacetRequest.SortOrder getSortOrder()
FacetRequest.SortOrder.DESCENDING
.
public int hashCode()
hashCode
in class Object
public void setDepth(int depth)
getDepth()
public void setNumLabel(int numLabel)
getNumLabel()
public void setResultMode(FacetRequest.ResultMode resultMode)
FacetRequest.ResultMode
for this request.
getResultMode()
public void setSortOrder(FacetRequest.SortOrder sortOrder)
FacetRequest.SortOrder
for this request.
getSortOrder()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |