Class PivotFacetField
java.lang.Object
org.apache.solr.handler.component.PivotFacetField
Models a single field somewhere in a hierarchy of fields as part of a pivot facet. This pivot
field contains
PivotFacetValues which may each contain a nested PivotFacetField
child. This PivotFacetField may itself be a child of a PivotFacetValue
parent.- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcontributeFromShard(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.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)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.voidA 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.toString()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 Details
-
field
-
parentValue
-
valueCollection
-
-
Method Details
-
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:
-
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:
-
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()- See Also:
-
sort
public void sort()Recursively sorts the collection of values associated with this field, and any sub-pivots those values have.- See Also:
-
convertToListOfNamedLists
A recursive method for generatingNamedListsfrom this field suitable for including in a pivot facet response to the original distributed request. -
queuePivotRefinementRequests
A recursive method for determining whichPivotFacetValues need to be refined for this pivot.- See Also:
-
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:
-
toString
-