org.apache.solr.handler.component

## Class RangeFacetRequest

- java.lang.Object
- - org.apache.solr.handler.component.FacetComponent.FacetBase
  - - org.apache.solr.handler.component.RangeFacetRequest

-     public class RangeFacetRequest
      extends FacetComponent.FacetBase

  Encapsulates a single facet.range request along with all its parameters. This class calculates all the ranges (gaps) required to be counted.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RangeFacetRequest.FacetRange` Represents a single facet range (or gap) for which the count is to be calculated

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `end`
    `protected Object` | `endObj` The computed end value of this range taking into account facet.range.hardend
    `protected List<RangeFacetRequest.FacetRange>` | `facetRanges`
    `protected String` | `gap`
    `protected Object` | `gapObj` The computed gap between each range
    `protected boolean` | `groupFacet`
    `protected boolean` | `hardEnd`
    `protected EnumSet<FacetParams.FacetRangeInclude>` | `include`
    `protected FacetParams.FacetRangeMethod` | `method`
    `protected int` | `minCount`
    `protected EnumSet<FacetParams.FacetRangeOther>` | `others`
    `protected SchemaField` | `schemaField`
    `protected String` | `start`
    `protected Object` | `startObj` The computed start value of this range

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RangeFacetRequest(ResponseBuilder rb, String f)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getEnd()` The end of this facet.range as specified by `FacetParams.FACET_RANGE_END` parameter
    `Object` | `getEndObj()` The end of this facet.range as calculated using the value of facet.range.end parameter and facet.range.hardend.
    `List<RangeFacetRequest.FacetRange>` | `getFacetRanges()`
    `String` | `getGap()`
    `Object` | `getGapObj()`
    `EnumSet<FacetParams.FacetRangeInclude>` | `getInclude()`
    `FacetParams.FacetRangeMethod` | `getMethod()`
    `int` | `getMinCount()`
    `EnumSet<FacetParams.FacetRangeOther>` | `getOthers()`
    `SchemaField` | `getSchemaField()`
    `String` | `getStart()`
    `Object` | `getStartObj()`
    `boolean` | `isGroupFacet()`
    `boolean` | `isHardEnd()`

    - ### 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, toString, wait, wait, wait`

- - ### Field Detail

    - #### schemaField

          protected final SchemaField schemaField

    - #### start

          protected final String start

    - #### end

          protected final String end

    - #### gap

          protected final String gap

    - #### hardEnd

          protected final boolean hardEnd

    - #### include

          protected final EnumSet<FacetParams.FacetRangeInclude> include

    - #### others

          protected final EnumSet<FacetParams.FacetRangeOther> others

    - #### method

          protected final FacetParams.FacetRangeMethod method

    - #### minCount

          protected final int minCount

    - #### groupFacet

          protected final boolean groupFacet

    - #### facetRanges

          protected final List<RangeFacetRequest.FacetRange> facetRanges

    - #### startObj

          protected final Object startObj

      The computed start value of this range

    - #### endObj

          protected final Object endObj

      The computed end value of this range taking into account facet.range.hardend

    - #### gapObj

          protected final Object gapObj

      The computed gap between each range

  - ### Constructor Detail

    - #### RangeFacetRequest

          public RangeFacetRequest(ResponseBuilder rb,
                                   String f)

  - ### Method Detail

    - #### getStart

          public String getStart()

      Returns:
        the start of this range as specified by `FacetParams.FACET_RANGE_START` parameter

    - #### getEnd

          public String getEnd()

      The end of this facet.range as specified by `FacetParams.FACET_RANGE_END` parameter

      Note that the actual computed end value can be different depending on the `FacetParams.FACET_RANGE_HARD_END` parameter. See `endObj`

    - #### getInclude

          public EnumSet<FacetParams.FacetRangeInclude> getInclude()

      Returns:
        an `EnumSet` containing all the values specified via `FacetParams.FACET_RANGE_INCLUDE` parameter. Defaults to `FacetParams.FacetRangeInclude.LOWER` if no parameter is supplied. Includes all values from `FacetParams.FacetRangeInclude` enum if `FacetParams.FACET_RANGE_INCLUDE` includes `FacetParams.FacetRangeInclude.ALL`

    - #### getGap

          public String getGap()

      Returns:
        the gap as specified by `FacetParams.FACET_RANGE_GAP` parameter

    - #### getGapObj

          public Object getGapObj()

      Returns:
        the computed gap object

    - #### isHardEnd

          public boolean isHardEnd()

      Returns:
        the boolean value of `FacetParams.FACET_RANGE_HARD_END` parameter

    - #### getOthers

          public EnumSet<FacetParams.FacetRangeOther> getOthers()

      Returns:
        an `EnumSet` of `FacetParams.FacetRangeOther` values specified by `FacetParams.FACET_RANGE_OTHER` parameter

    - #### getMethod

          public FacetParams.FacetRangeMethod getMethod()

      Returns:
        the `FacetParams.FacetRangeMethod` to be used for computing ranges determined either by the value of `FacetParams.FACET_RANGE_METHOD` parameter or other internal constraints.

    - #### getMinCount

          public int getMinCount()

      Returns:
        the minimum allowed count for facet ranges as specified by `FacetParams.FACET_MINCOUNT`

    - #### getSchemaField

          public SchemaField getSchemaField()

      Returns:
        the `SchemaField` instance representing the field on which ranges have to be calculated

    - #### isGroupFacet

          public boolean isGroupFacet()

      Returns:
        the boolean value specified by `GroupParams.GROUP_FACET` parameter

    - #### getFacetRanges

          public List<RangeFacetRequest.FacetRange> getFacetRanges()

      Returns:
        a `List` of `RangeFacetRequest.FacetRange` objects representing the ranges (gaps) for which range counts are to be calculated.

    - #### getStartObj

          public Object getStartObj()

      Returns:
        The computed start value of this range

    - #### getEndObj

          public Object getEndObj()

      The end of this facet.range as calculated using the value of facet.range.end parameter and facet.range.hardend. This can be different from the value specified in facet.range.end if facet.range.hardend=true

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