Class PivotFacetValue
- java.lang.Object
-
- org.apache.solr.handler.component.PivotFacetValue
-
public class PivotFacetValue extends Object
Models a single (value, count) pair that will exist in the collection of values for aPivotFacetFieldparent. ThisPivotFacetValuemay itself have a nestedPivotFacetFieldchild- See Also:
PivotFacetField,PivotFacetFieldValueCollection
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.solr.common.util.NamedList<Object>convertToNamedList()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.PivotFacetFieldgetChildPivot()ThePivotFacetFieldcorrisponding to the nested child pivot for thisPivotFacetValue.intgetCount()The count corrisponding to the value modeled by thisPivotFacetValueComparablegetValue()The value of the asssocated field modeled by thisPivotFacetValue.List<String>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.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.StringtoString()
-
-
-
Method Detail
-
getValue
public Comparable 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:
FacetParams.FACET_MISSING
-
getCount
public int getCount()
The count corrisponding to the value modeled by thisPivotFacetValue
-
getChildPivot
public PivotFacetField getChildPivot()
ThePivotFacetFieldcorrisponding to the nested child pivot for thisPivotFacetValue. May be null if this object is the leaf of a pivot.
-
getValuePath
public List<String> 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:
PivotFacetField.getValuePath()
-
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:
PivotFacetField.createFromListOfNamedLists(int, org.apache.solr.handler.component.ResponseBuilder, org.apache.solr.handler.component.PivotFacetValue, java.util.List<org.apache.solr.common.util.NamedList<java.lang.Object>>)
-
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
public org.apache.solr.common.util.NamedList<Object> convertToNamedList()
A recursive method for generating a NamedList from this value suitable for including in a pivot facet response to the original distributed request.
-
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:
PivotFacetField.contributeFromShard(int, org.apache.solr.handler.component.ResponseBuilder, java.util.List<org.apache.solr.common.util.NamedList<java.lang.Object>>),PivotFacetField.createFromListOfNamedLists(int, org.apache.solr.handler.component.ResponseBuilder, org.apache.solr.handler.component.PivotFacetValue, java.util.List<org.apache.solr.common.util.NamedList<java.lang.Object>>)
-
-