Class PivotFacet
- java.lang.Object
-
- org.apache.solr.handler.component.FacetComponent.FacetBase
-
- org.apache.solr.handler.component.PivotFacet
-
public class PivotFacet extends FacetComponent.FacetBase
Models a single instance of a "pivot" specified by aFacetParams.FACET_PIVOT
param, which may contain multiple nested fields.This class is also used to coordinate the refinement requests needed from various shards when doing processing a distributed request
-
-
Field Summary
Fields Modifier and Type Field Description BitSet
knownShards
static String
REFINE_PARAM
Local param used to indicate that refinements are required on a pivot.
-
Constructor Summary
Constructors Constructor Description PivotFacet(ResponseBuilder rb, String facetStr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRefinement(int shardNumber, PivotFacetValue value)
Tracks that the specified shard needs to be asked to refine the specifiedPivotFacetValue
List<PivotFacetValue>
getQueuedRefinements(int shardNumber)
An immutable List of thePivotFacetValue
s that need to be refined for this pivot.List<org.apache.solr.common.util.NamedList<Object>>
getTrimmedPivotsAsListOfNamedLists()
A recursive method for generatingNamedLists
for this pivot suitable for including in a pivot facet response to the original distributed request.boolean
isRefinementsRequired()
If true, then additional refinement requests are needed to flesh out the correct counts for this Pivotvoid
mergeResponseFromShard(int shardNumber, ResponseBuilder rb, List<org.apache.solr.common.util.NamedList<Object>> response)
Recursively merges the response from the specified shard, tracking the known shards.void
queuePivotRefinementRequests()
A recursive method for determining whichPivotFacetValue
s need to be refined for this pivot.void
removeAllRefinementsForShard(int shardNumber)
Clears the list of queued refinements for the specified shardString
toString()
-
Methods inherited from class org.apache.solr.handler.component.FacetComponent.FacetBase
getExcludeTags, getKey, getTags, getThreadCount, getType
-
-
-
-
Field Detail
-
REFINE_PARAM
public static final String REFINE_PARAM
Local param used to indicate that refinements are required on a pivot. Should also be used as the prefix for concatenating with the value to determine the name of the multi-valued param that will contain all of the values needed for refinement.- See Also:
- Constant Field Values
-
knownShards
public final BitSet knownShards
-
-
Constructor Detail
-
PivotFacet
public PivotFacet(ResponseBuilder rb, String facetStr)
-
-
Method Detail
-
addRefinement
public void addRefinement(int shardNumber, PivotFacetValue value)
Tracks that the specified shard needs to be asked to refine the specifiedPivotFacetValue
- See Also:
getQueuedRefinements(int)
-
getQueuedRefinements
public List<PivotFacetValue> getQueuedRefinements(int shardNumber)
An immutable List of thePivotFacetValue
s that need to be refined for this pivot. Once these refinements have been processed, the caller should clear them usingremoveAllRefinementsForShard(int)
- Returns:
- a list of the values to refine, or an empty list.
- See Also:
addRefinement(int, org.apache.solr.handler.component.PivotFacetValue)
,removeAllRefinementsForShard(int)
-
removeAllRefinementsForShard
public void removeAllRefinementsForShard(int shardNumber)
Clears the list of queued refinements for the specified shard
-
isRefinementsRequired
public boolean isRefinementsRequired()
If true, then additional refinement requests are needed to flesh out the correct counts for this Pivot- See Also:
getQueuedRefinements(int)
-
getTrimmedPivotsAsListOfNamedLists
public List<org.apache.solr.common.util.NamedList<Object>> getTrimmedPivotsAsListOfNamedLists()
A recursive method for generatingNamedLists
for this pivot suitable for including in a pivot facet response to the original distributed request.
-
queuePivotRefinementRequests
public void queuePivotRefinementRequests()
A recursive method for determining whichPivotFacetValue
s need to be refined for this pivot.
-
mergeResponseFromShard
public void mergeResponseFromShard(int shardNumber, ResponseBuilder rb, List<org.apache.solr.common.util.NamedList<Object>> response)
Recursively merges the response from the specified shard, tracking the known shards.- 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>>)
-
-