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 Description static classRangeFacetRequest.FacetRangeRepresents a single facet range (or gap) for which the count is to be calculated
-
Field Summary
Fields Modifier and Type Field Description protected Stringendprotected ObjectendObjThe computed end value of this range taking into account facet.range.hardendprotected List<RangeFacetRequest.FacetRange>facetRangesprotected Stringgapprotected ObjectgapObjThe computed gap between each rangeprotected booleangroupFacetprotected booleanhardEndprotected EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeInclude>includeprotected org.apache.solr.common.params.FacetParams.FacetRangeMethodmethodprotected intminCountprotected EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeOther>othersprotected SchemaFieldschemaFieldprotected Stringstartprotected ObjectstartObjThe computed start value of this range
-
Constructor Summary
Constructors Constructor Description RangeFacetRequest(ResponseBuilder rb, String f)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetEnd()The end of this facet.range as specified byFacetParams.FACET_RANGE_ENDparameterObjectgetEndObj()The end of this facet.range as calculated using the value of facet.range.end parameter and facet.range.hardend.List<RangeFacetRequest.FacetRange>getFacetRanges()StringgetGap()ObjectgetGapObj()EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeInclude>getInclude()org.apache.solr.common.params.FacetParams.FacetRangeMethodgetMethod()intgetMinCount()EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeOther>getOthers()SchemaFieldgetSchemaField()StringgetStart()ObjectgetStartObj()booleanisGroupFacet()booleanisHardEnd()-
Methods inherited from class org.apache.solr.handler.component.FacetComponent.FacetBase
getExcludeTags, getKey, getTags, getThreadCount, getType
-
-
-
-
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<org.apache.solr.common.params.FacetParams.FacetRangeInclude> include
-
others
protected final EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeOther> others
-
method
protected final org.apache.solr.common.params.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_STARTparameter
-
getEnd
public String getEnd()
The end of this facet.range as specified byFacetParams.FACET_RANGE_ENDparameterNote that the actual computed end value can be different depending on the
FacetParams.FACET_RANGE_HARD_ENDparameter. SeeendObj
-
getInclude
public EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeInclude> getInclude()
- Returns:
- an
EnumSetcontaining all the values specified viaFacetParams.FACET_RANGE_INCLUDEparameter. Defaults toFacetParams.FacetRangeInclude.LOWERif no parameter is supplied. Includes all values fromFacetParams.FacetRangeIncludeenum ifFacetParams.FACET_RANGE_INCLUDEincludesFacetParams.FacetRangeInclude.ALL
-
getGap
public String getGap()
- Returns:
- the gap as specified by
FacetParams.FACET_RANGE_GAPparameter
-
getGapObj
public Object getGapObj()
- Returns:
- the computed gap object
-
isHardEnd
public boolean isHardEnd()
- Returns:
- the boolean value of
FacetParams.FACET_RANGE_HARD_ENDparameter
-
getOthers
public EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeOther> getOthers()
- Returns:
- an
EnumSetofFacetParams.FacetRangeOthervalues specified byFacetParams.FACET_RANGE_OTHERparameter
-
getMethod
public org.apache.solr.common.params.FacetParams.FacetRangeMethod getMethod()
- Returns:
- the
FacetParams.FacetRangeMethodto be used for computing ranges determined either by the value ofFacetParams.FACET_RANGE_METHODparameter 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
SchemaFieldinstance representing the field on which ranges have to be calculated
-
isGroupFacet
public boolean isGroupFacet()
- Returns:
- the boolean value specified by
GroupParams.GROUP_FACETparameter
-
getFacetRanges
public List<RangeFacetRequest.FacetRange> getFacetRanges()
- Returns:
- a
ListofRangeFacetRequest.FacetRangeobjects 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
-
-