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 containsPivotFacetValue
s which may each contain a nestedPivotFacetField
child. ThisPivotFacetField
may itself be a child of aPivotFacetValue
parent.- See Also:
PivotFacetValue
,PivotFacetFieldValueCollection
-
-
Field Summary
Fields Modifier and Type Field Description String
field
PivotFacetValue
parentValue
PivotFacetFieldValueCollection
valueCollection
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contributeFromShard(int shardNumber, ResponseBuilder rb, List<org.apache.solr.common.util.NamedList<Object>> response)
Recursively merges the contributions from the specified shard for eachPivotFacetValue
represended in theresponse
.List<org.apache.solr.common.util.NamedList<Object>>
convertToListOfNamedLists()
A recursive method for generatingNamedLists
from this field suitable for including in a pivot facet response to the original distributed request.static PivotFacetField
createFromListOfNamedLists(int shardNumber, ResponseBuilder rb, PivotFacetValue owner, List<org.apache.solr.common.util.NamedList<Object>> pivotValues)
A recursive method to construct a newPivotFacetField
object from the contents of theNamedList
s 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.void
queuePivotRefinementRequests(PivotFacet pf)
A recursive method for determining whichPivotFacetValue
s need to be refined for this pivot.void
sort()
Recursively sorts the collection of values associated with this field, and any sub-pivots those values have.String
toString()
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.
-
-
-
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 newPivotFacetField
object from the contents of theNamedList
s provided by the specified shard, relative to a parent value (if this is not the top field in the pivot hierarchy)The associated child
PivotFacetValue
s 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 generatingNamedLists
from 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 whichPivotFacetValue
s 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 eachPivotFacetValue
represended 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>)
-
-