Class PivotFacetValue
java.lang.Object
org.apache.solr.handler.component.PivotFacetValue
Models a single (value, count) pair that will exist in the collection of values for a
PivotFacetField parent. This PivotFacetValue may itself have a nested PivotFacetField child- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.solr.common.util.NamedList<Object> A recursive method for generating a NamedList from this value suitable for including in a pivot facet response to the original distributed request.static PivotFacetValuecreateFromNamedList(int shardNumber, ResponseBuilder rb, PivotFacetField parentField, org.apache.solr.common.util.NamedList<Object> pivotData) A recursive method to construct a newPivotFacetValueobject from the contents of theNamedListprovided by the specified shard, relative to the specified field.ThePivotFacetFieldcorrisponding to the nested child pivot for thisPivotFacetValue.intgetCount()The count corrisponding to the value modeled by thisPivotFacetValuegetValue()The value of the asssocated field modeled by thisPivotFacetValue.A recursive method that walks up the tree of pivot fields/values to build a list of the String representations of the values that lead down to this PivotFacetValue.voidmergeContributionFromShard(int shardNumber, ResponseBuilder rb, org.apache.solr.common.util.NamedList<Object> value) Merges in the count contributions from the specified shard for each.booleanshardHasContributed(int shardNum) A NON-Recursive method indicating if the specified shard has already contributed to the count for this value.toString()
-
Method Details
-
getValue
The value of the asssocated field modeled by thisPivotFacetValue. May be null if thisPivotFacetValuemodels the count for docs "missing" the field value.- See Also:
-
getCount
public int getCount()The count corrisponding to the value modeled by thisPivotFacetValue -
getChildPivot
ThePivotFacetFieldcorrisponding to the nested child pivot for thisPivotFacetValue. May be null if this object is the leaf of a pivot. -
getValuePath
A recursive method that walks up the tree of pivot fields/values to build a list of the String representations of the values that lead down to this PivotFacetValue.- Returns:
- a mutable List of the pivot value Strings leading down to and including this pivot value, will never be null but may contain nulls
- See Also:
-
createFromNamedList
public static PivotFacetValue createFromNamedList(int shardNumber, ResponseBuilder rb, PivotFacetField parentField, org.apache.solr.common.util.NamedList<Object> pivotData) A recursive method to construct a newPivotFacetValueobject from the contents of theNamedListprovided by the specified shard, relative to the specified field.If the
NamedListcontains data for a childPivotFacetFieldthat will be recursively built as well.- Parameters:
shardNumber- the id of the shard that provided this datarb- The response builder of the current requestparentField- the parent field in the current pivot associated with this valuepivotData- the data from the specified shard for this pivot value- See Also:
-
shardHasContributed
public boolean shardHasContributed(int shardNum) A NON-Recursive method indicating if the specified shard has already contributed to the count for this value. -
convertToNamedList
A recursive method for generating a NamedList from this value suitable for including in a pivot facet response to the original distributed request.- See Also:
-
mergeContributionFromShard
public void mergeContributionFromShard(int shardNumber, ResponseBuilder rb, org.apache.solr.common.util.NamedList<Object> value) Merges in the count contributions from the specified shard for each. This method is recursive if the shard data includes sub-pivots- See Also:
-
toString
-