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 aPivotFacetField
parent. ThisPivotFacetValue
may itself have a nestedPivotFacetField
child- 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 PivotFacetValue
createFromNamedList(int shardNumber, ResponseBuilder rb, PivotFacetField parentField, org.apache.solr.common.util.NamedList<Object> pivotData)
A recursive method to construct a newPivotFacetValue
object from the contents of theNamedList
provided by the specified shard, relative to the specified field.PivotFacetField
getChildPivot()
ThePivotFacetField
corrisponding to the nested child pivot for thisPivotFacetValue
.int
getCount()
The count corrisponding to the value modeled by thisPivotFacetValue
Comparable
getValue()
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.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.boolean
shardHasContributed(int shardNum)
A NON-Recursive method indicating if the specified shard has already contributed to the count for this value.String
toString()
-
-
-
Method Detail
-
getValue
public Comparable getValue()
The value of the asssocated field modeled by thisPivotFacetValue
. May be null if thisPivotFacetValue
models 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()
ThePivotFacetField
corrisponding 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 newPivotFacetValue
object from the contents of theNamedList
provided by the specified shard, relative to the specified field.If the
NamedList
contains data for a childPivotFacetField
that 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>>)
-
-