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 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 Description protected String
end
protected Object
endObj
The computed end value of this range taking into account facet.range.hardendprotected List<RangeFacetRequest.FacetRange>
facetRanges
protected String
gap
protected Object
gapObj
The computed gap between each rangeprotected boolean
groupFacet
protected boolean
hardEnd
protected EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeInclude>
include
protected org.apache.solr.common.params.FacetParams.FacetRangeMethod
method
protected int
minCount
protected EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeOther>
others
protected SchemaField
schemaField
protected String
start
protected Object
startObj
The 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 String
getEnd()
The end of this facet.range as specified byFacetParams.FACET_RANGE_END
parameterObject
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<org.apache.solr.common.params.FacetParams.FacetRangeInclude>
getInclude()
org.apache.solr.common.params.FacetParams.FacetRangeMethod
getMethod()
int
getMinCount()
EnumSet<org.apache.solr.common.params.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
-
-
-
-
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_START
parameter
-
getEnd
public String getEnd()
The end of this facet.range as specified byFacetParams.FACET_RANGE_END
parameterNote that the actual computed end value can be different depending on the
FacetParams.FACET_RANGE_HARD_END
parameter. SeeendObj
-
getInclude
public EnumSet<org.apache.solr.common.params.FacetParams.FacetRangeInclude> getInclude()
- Returns:
- an
EnumSet
containing all the values specified viaFacetParams.FACET_RANGE_INCLUDE
parameter. Defaults toFacetParams.FacetRangeInclude.LOWER
if no parameter is supplied. Includes all values fromFacetParams.FacetRangeInclude
enum ifFacetParams.FACET_RANGE_INCLUDE
includesFacetParams.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<org.apache.solr.common.params.FacetParams.FacetRangeOther> getOthers()
- Returns:
- an
EnumSet
ofFacetParams.FacetRangeOther
values specified byFacetParams.FACET_RANGE_OTHER
parameter
-
getMethod
public org.apache.solr.common.params.FacetParams.FacetRangeMethod getMethod()
- Returns:
- the
FacetParams.FacetRangeMethod
to be used for computing ranges determined either by the value ofFacetParams.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
ofRangeFacetRequest.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
-
-