Class PivotFacetField
- java.lang.Object
-
- org.apache.solr.handler.component.PivotFacetField
-
public class PivotFacetField extends Object
Models a single field somewhere in a hierarchy of fields as part of a pivot facet. This pivot field containsPivotFacetValues which may each contain a nestedPivotFacetFieldchild. ThisPivotFacetFieldmay itself be a child of aPivotFacetValueparent.- See Also:
PivotFacetValue,PivotFacetFieldValueCollection
-
-
Field Summary
Fields Modifier and Type Field Description StringfieldPivotFacetValueparentValuePivotFacetFieldValueCollectionvalueCollection
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontributeFromShard(int shardNumber, ResponseBuilder rb, List<org.apache.solr.common.util.NamedList<Object>> response)Recursively merges the contributions from the specified shard for eachPivotFacetValuerepresended in theresponse.List<org.apache.solr.common.util.NamedList<Object>>convertToListOfNamedLists()A recursive method for generatingNamedListsfrom this field suitable for including in a pivot facet response to the original distributed request.static PivotFacetFieldcreateFromListOfNamedLists(int shardNumber, ResponseBuilder rb, PivotFacetValue owner, List<org.apache.solr.common.util.NamedList<Object>> pivotValues)A recursive method to construct a newPivotFacetFieldobject from the contents of theNamedLists provided by the specified shard, relative to a parent value (if this is not the top field in the pivot hierarchy)List<String>getValuePath()A recursive method that walks up the tree of pivot fields/values to build a list of String representations of the values that lead down to this PivotFacetField.voidqueuePivotRefinementRequests(PivotFacet pf)A recursive method for determining whichPivotFacetValues need to be refined for this pivot.voidsort()Recursively sorts the collection of values associated with this field, and any sub-pivots those values have.StringtoString()voidtrim()Destructive method that recursively prunes values from the data structure based on the counts for those values and the effective sort, mincount, limit, and offset being used for each field.
-
-
-
Field Detail
-
field
public final String field
-
parentValue
public final PivotFacetValue parentValue
-
valueCollection
public final PivotFacetFieldValueCollection valueCollection
-
-
Method Detail
-
getValuePath
public List<String> getValuePath()
A recursive method that walks up the tree of pivot fields/values to build a list of String representations of the values that lead down to this PivotFacetField.- Returns:
- A mutable List of the pivot values leading down to this pivot field, will never be null but may contain nulls and may be empty if this is a top level pivot field
- See Also:
PivotFacetValue.getValuePath()
-
createFromListOfNamedLists
public static PivotFacetField createFromListOfNamedLists(int shardNumber, ResponseBuilder rb, PivotFacetValue owner, List<org.apache.solr.common.util.NamedList<Object>> pivotValues)
A recursive method to construct a newPivotFacetFieldobject from the contents of theNamedLists provided by the specified shard, relative to a parent value (if this is not the top field in the pivot hierarchy)The associated child
PivotFacetValues will be recursively built as well.- Parameters:
shardNumber- the id of the shard that provided this datarb- The response builder of the current requestowner- the parent value in the current pivot (may be null)pivotValues- the data from the specified shard for this pivot field, may be null or empty- Returns:
- the new PivotFacetField, null if pivotValues is null or empty.
- See Also:
PivotFacetValue.createFromNamedList(int, org.apache.solr.handler.component.ResponseBuilder, org.apache.solr.handler.component.PivotFacetField, org.apache.solr.common.util.NamedList<java.lang.Object>)
-
trim
public void trim()
Destructive method that recursively prunes values from the data structure based on the counts for those values and the effective sort, mincount, limit, and offset being used for each field.This method should only be called after all refinement is completed just prior calling
convertToListOfNamedLists()
-
sort
public void sort()
Recursively sorts the collection of values associated with this field, and any sub-pivots those values have.- See Also:
FacetParams.FACET_SORT,PivotFacetFieldValueCollection.sort()
-
convertToListOfNamedLists
public List<org.apache.solr.common.util.NamedList<Object>> convertToListOfNamedLists()
A recursive method for generatingNamedListsfrom this field suitable for including in a pivot facet response to the original distributed request.
-
queuePivotRefinementRequests
public void queuePivotRefinementRequests(PivotFacet pf)
A recursive method for determining whichPivotFacetValues need to be refined for this pivot.
-
contributeFromShard
public void contributeFromShard(int shardNumber, ResponseBuilder rb, List<org.apache.solr.common.util.NamedList<Object>> response)Recursively merges the contributions from the specified shard for eachPivotFacetValuerepresended in theresponse.- Parameters:
shardNumber- the id of the shard that provided this datarb- The response builder of the current requestresponse- the data from the specified shard for this pivot field, may be null- See Also:
PivotFacetValue.mergeContributionFromShard(int, org.apache.solr.handler.component.ResponseBuilder, org.apache.solr.common.util.NamedList<java.lang.Object>)
-
-