org.apache.solr.handler.component

## Class PivotFacetField

- java.lang.Object
- - org.apache.solr.handler.component.PivotFacetField

-     public class PivotFacetField
      extends Object

  Models a single field somewhere in a hierarchy of fields as part of a pivot facet. This pivot field contains `PivotFacetValue`s which may each contain a nested `PivotFacetField` child. This `PivotFacetField` may itself be a child of a `PivotFacetValue` parent.
  See Also:
    `PivotFacetValue`, `PivotFacetFieldValueCollection`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `field`
    `PivotFacetValue` | `parentValue`
    `PivotFacetFieldValueCollection` | `valueCollection`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `contributeFromShard(int shardNumber, ResponseBuilder rb, List<NamedList<Object>> response)` Recursively merges the contributions from the specified shard for each `PivotFacetValue` represended in the `response`.
    `List<NamedList<Object>>` | `convertToListOfNamedLists()` A recursive method for generating `NamedLists` from this field suitable for including in a pivot facet response to the original distributed request.
    `static PivotFacetField` | `createFromListOfNamedLists(int shardNumber, ResponseBuilder rb, PivotFacetValue owner, List<NamedList<Object>> pivotValues)` A recursive method to construct a new `PivotFacetField` object from the contents of the `NamedList`s provided by the specified shard, relative to a parent value (if this is not the top field in the pivot hierarchy) The associated child `PivotFacetValue`s will be recursively built as well.
    `List<String>` | `getValuePath()` A recursive method that walks up the tree of pivot fields/values to build a list of String representations of the values that lead down to this PivotFacetField.
    `void` | `queuePivotRefinementRequests(PivotFacet pf)` A recursive method for determining which `PivotFacetValue`s need to be refined for this pivot.
    `void` | `sort()` Recursively sorts the collection of values associated with this field, and any sub-pivots those values have.
    `String` | `toString()`
    `void` | `trim()` Destructive method that recursively prunes values from the data structure based on the counts for those values and the effective sort, mincount, limit, and offset being used for each field.

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

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

- - ### Field Detail

    - #### field

          public final String field

    - #### parentValue

          public final PivotFacetValue parentValue

    - #### valueCollection

          public final PivotFacetFieldValueCollection valueCollection

  - ### Method Detail

    - #### getValuePath

          public List<String> getValuePath()

      A recursive method that walks up the tree of pivot fields/values to build a list of String representations of the values that lead down to this PivotFacetField.
      Returns:
        A mutable List of the pivot values leading down to this pivot field, will never be null but may contain nulls and may be empty if this is a top level pivot field
      See Also:
        `PivotFacetValue.getValuePath()`

    - #### createFromListOfNamedLists

          public static PivotFacetField createFromListOfNamedLists(int shardNumber,
                                                                   ResponseBuilder rb,
                                                                   PivotFacetValue owner,
                                                                   List<NamedList<Object>> pivotValues)

      A recursive method to construct a new `PivotFacetField` object from the contents of the `NamedList`s provided by the specified shard, relative to a parent value (if this is not the top field in the pivot hierarchy) The associated child `PivotFacetValue`s will be recursively built as well.
      Parameters:
        `shardNumber` - the id of the shard that provided this data
        `rb` - The response builder of the current request
        `owner` - the parent value in the current pivot (may be null)
        `pivotValues` - the data from the specified shard for this pivot field, may be null or empty
      Returns:
        the new PivotFacetField, null if pivotValues is null or empty.
      See Also:
        `PivotFacetValue.createFromNamedList(int, org.apache.solr.handler.component.ResponseBuilder, org.apache.solr.handler.component.PivotFacetField, org.apache.solr.common.util.NamedList<java.lang.Object>)`

    - #### trim

          public void trim()

      Destructive method that recursively prunes values from the data structure based on the counts for those values and the effective sort, mincount, limit, and offset being used for each field.

      This method should only be called after all refinement is completed just prior calling `convertToListOfNamedLists()`

      See Also:
        `PivotFacet.getTrimmedPivotsAsListOfNamedLists()`, `PivotFacetFieldValueCollection.trim()`

    - #### sort

          public void sort()

      Recursively sorts the collection of values associated with this field, and any sub-pivots those values have.
      See Also:
        `FacetParams.FACET_SORT`, `PivotFacetFieldValueCollection.sort()`

    - #### convertToListOfNamedLists

          public List<NamedList<Object>> convertToListOfNamedLists()

      A recursive method for generating `NamedLists` from this field suitable for including in a pivot facet response to the original distributed request.

    - #### queuePivotRefinementRequests

          public void queuePivotRefinementRequests(PivotFacet pf)

      A recursive method for determining which `PivotFacetValue`s need to be refined for this pivot.
      See Also:
        `PivotFacet.queuePivotRefinementRequests()`

    - #### contributeFromShard

          public void contributeFromShard(int shardNumber,
                                          ResponseBuilder rb,
                                          List<NamedList<Object>> response)

      Recursively merges the contributions from the specified shard for each `PivotFacetValue` represended in the `response`.
      Parameters:
        `shardNumber` - the id of the shard that provided this data
        `rb` - The response builder of the current request
        `response` - the data from the specified shard for this pivot field, may be null
      See Also:
        `PivotFacetValue.mergeContributionFromShard(int, org.apache.solr.handler.component.ResponseBuilder, 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.