org.apache.solr.handler.component

## 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 a `FacetParams.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 and Description
    --- | ---
    `BitSet` | `knownShards`
    `static String` | `REFINE_PARAM` Local param used to indicate that refinements are required on a pivot.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PivotFacet(ResponseBuilder rb, String facetStr)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRefinement(int shardNumber, PivotFacetValue value)` Tracks that the specified shard needs to be asked to refine the specified `PivotFacetValue`
    `List<PivotFacetValue>` | `getQueuedRefinements(int shardNumber)` An immutable List of the `PivotFacetValue`s that need to be refined for this pivot.
    `List<NamedList<Object>>` | `getTrimmedPivotsAsListOfNamedLists()` A recursive method for generating `NamedLists` 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 Pivot
    `void` | `mergeResponseFromShard(int shardNumber, ResponseBuilder rb, List<NamedList<Object>> response)` Recursively merges the response from the specified shard, tracking the known shards.
    `void` | `queuePivotRefinementRequests()` A recursive method for determining which `PivotFacetValue`s need to be refined for this pivot.
    `void` | `removeAllRefinementsForShard(int shardNumber)` Clears the list of queued refinements for the specified shard
    `String` | `toString()`

    - ### Methods inherited from class org.apache.solr.handler.component.FacetComponent.FacetBase

      `getExcludeTags, getKey, getTags, getThreadCount, getType`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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 specified `PivotFacetValue`
      See Also:
        `getQueuedRefinements(int)`

    - #### getQueuedRefinements

          public List<PivotFacetValue> getQueuedRefinements(int shardNumber)

      An immutable List of the `PivotFacetValue`s that need to be refined for this pivot. Once these refinements have been processed, the caller should clear them using `removeAllRefinementsForShard(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
      See Also:
        `addRefinement(int, org.apache.solr.handler.component.PivotFacetValue)`, `getQueuedRefinements(int)`

    - #### 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<NamedList<Object>> getTrimmedPivotsAsListOfNamedLists()

      A recursive method for generating `NamedLists` for this pivot suitable for including in a pivot facet response to the original distributed request.
      See Also:
        `PivotFacetField.trim()`, `PivotFacetField.convertToListOfNamedLists()`

    - #### queuePivotRefinementRequests

          public void queuePivotRefinementRequests()

      A recursive method for determining which `PivotFacetValue`s need to be refined for this pivot.
      See Also:
        `PivotFacetField.queuePivotRefinementRequests(org.apache.solr.handler.component.PivotFacet)`

    - #### mergeResponseFromShard

          public void mergeResponseFromShard(int shardNumber,
                                             ResponseBuilder rb,
                                             List<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>>)`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.