Class FacetOptions.FieldWithRangeParameters<T extends FacetOptions.FieldWithRangeParameters<?,?,?>,R,G>

Type Parameters:
T - range field implementation type
R - type of range
G - type of gap
All Implemented Interfaces:
Iterable<FacetOptions.FacetParameter>, Field
Direct Known Subclasses:
FacetOptions.FieldWithDateRangeParameters, FacetOptions.FieldWithNumericRangeParameters
Enclosing class:
FacetOptions

public abstract static class FacetOptions.FieldWithRangeParameters<T extends FacetOptions.FieldWithRangeParameters<?,?,?>,R,G> extends FieldWithQueryParameters<FacetOptions.FacetParameter>
Class representing common facet range parameters.
Since:
1.5
  • Constructor Details

    • FieldWithRangeParameters

      public FieldWithRangeParameters(String name, R start, R end, G gap)
      Parameters:
      name - field name
      start - range facet start
      end - range facet end
      gap - gap to be used for faceting between start and end
  • Method Details

    • setHardEnd

      public T setHardEnd(Boolean rangeHardEnd)
      Defines if the last range should be abruptly ended even if the end doesn't satisfies: (start - end) % gap = 0.
      Parameters:
      rangeHardEnd - whenever false will expect to have the last range with the same size as the other ranges entries for the query, otherwise (true), may present the last range smaller than the other range entries.
      Returns:
      this
      See Also:
      • FacetParams.FACET_RANGE_HARD_END
    • getHardEnd

      @Nullable public Boolean getHardEnd()
      If the last range should be abruptly ended even if the end doesn't satisfies: (start - end) % gap = 0.
      Returns:
      if hard end should be used, null will be returned if not set
      See Also:
      • FacetParams.FACET_RANGE_HARD_END
    • setOther

      public T setOther(org.apache.solr.common.params.FacetParams.FacetRangeOther rangeOther)
      Defines the additional (other) counts for the range facet, i.e. count of documents that are before start of the range facet, end of range facet or even between start and end.
      Parameters:
      rangeOther - which other counts shall be added to the facet result
      Returns:
      this
      See Also:
      • FacetParams.FacetRangeOther
    • getOther

      @Nullable public org.apache.solr.common.params.FacetParams.FacetRangeOther getOther()
      The definition of additional (other) counts for the range facet.
      Returns:
      null which other counts shall be added to the facet result
      See Also:
      • FacetParams.FacetRangeOther
    • setInclude

      public T setInclude(org.apache.solr.common.params.FacetParams.FacetRangeInclude rangeInclude)
      Defines how boundaries (lower and upper) shall be handled (exclusive or inclusive) on range facet requests.
      Parameters:
      rangeInclude - include option for range
      Returns:
      this
      See Also:
      • FacetParams.FacetRangeInclude
    • getInclude

      @Nullable public org.apache.solr.common.params.FacetParams.FacetRangeInclude getInclude()
      The definition of how boundaries (lower and upper) shall be handled (exclusive or inclusive) on range facet requests.
      Returns:
      null if not set
      See Also:
      • FacetParams.FacetRangeInclude
    • addFacetRangeParameter

      protected T addFacetRangeParameter(String parameterName, Object value)
    • getGap

      public G getGap()
      The size of the range to be added to the lower bound.
      Returns:
      size of each range.
      See Also:
      • FacetParams.FACET_RANGE_GAP
    • getStart

      public R getStart()
      Start value configured for this field range facet.
      Returns:
      upper bound for the ranges.
      See Also:
      • FacetParams.FACET_RANGE_START
    • getEnd

      public R getEnd()
      Returns:
      lower bound for the ranges.
      See Also:
      • FacetParams.FACET_RANGE_END