Package org.apache.solr.client.solrj.request.json

# Class RangeFacetMap

java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
org.apache.solr.client.solrj.request.json.JsonFacetMap<RangeFacetMap>
org.apache.solr.client.solrj.request.json.RangeFacetMap

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Map<String,Object>`

public class RangeFacetMap extends JsonFacetMap<RangeFacetMap>
Represents a "range" facet in a JSON request query.

Ready for use with `JsonQueryRequest.withFacet(String, Map)`

See Also:
  - Serialized Form

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`RangeFacetMap.OtherBuckets`

## Nested classes/interfaces inherited from class java.util.AbstractMap

`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

## Nested classes/interfaces inherited from interface java.util.Map

`Map.Entry<K,V>`

## Constructor Summary

Constructors
Constructor
Description
`RangeFacetMap(String field, double start, double end, double gap)`
`RangeFacetMap(String field, long start, long end, long gap)`
`RangeFacetMap(String field, Date start, Date end, String gap)`
Creates a "range" facet representation for a date field

## Method Summary

Modifier and Type
Method
Description
`RangeFacetMap`
`getThis()`
`RangeFacetMap`
`setHardEnd(boolean hardEnd)`
Indicates whether the facet's last bucket should stop exactly at `end`, or be extended to be `gap` wide
`RangeFacetMap`
`setMinCount(int minOccurrences)`
Indicates that buckets should be returned only if they have a count of at least `minOccurrences`
`RangeFacetMap`
`setOtherBuckets(RangeFacetMap.OtherBuckets bucketSpecifier)`
Indicates that an additional range bucket(s) should be computed and added to those computed for `start` and `end`

### Methods inherited from class org.apache.solr.client.solrj.request.json.JsonFacetMap

`withDomain, withStatSubFacet, withSubFacet`

### Methods inherited from class java.util.HashMap

`clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values`

### Methods inherited from class java.util.AbstractMap

`equals, hashCode, toString`

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

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Map

`equals, hashCode`

## Constructor Details

### RangeFacetMap

public RangeFacetMap(String field, long start, long end, long gap)

### RangeFacetMap

public RangeFacetMap(String field, double start, double end, double gap)

### RangeFacetMap

public RangeFacetMap(String field, Date start, Date end, String gap)
Creates a "range" facet representation for a date field

Parameters:
  `gap` - a DateMathParser compatible time/interval String. (e.g. "+1MONTH")

## Method Details

### getThis

public RangeFacetMap getThis()

Specified by:
  `getThis` in class `JsonFacetMap<RangeFacetMap>`

### setHardEnd

public RangeFacetMap setHardEnd(boolean hardEnd)
Indicates whether the facet's last bucket should stop exactly at `end`, or be extended to be `gap` wide

Defaults to false if not specified.

Parameters:
  `hardEnd` - true if the final bucket should be truncated at `end`; false otherwise

### setOtherBuckets

public RangeFacetMap setOtherBuckets(RangeFacetMap.OtherBuckets bucketSpecifier)
Indicates that an additional range bucket(s) should be computed and added to those computed for `start` and `end`

See `RangeFacetMap.OtherBuckets` for possible options.

### setMinCount

public RangeFacetMap setMinCount(int minOccurrences)
Indicates that buckets should be returned only if they have a count of at least `minOccurrences`

Defaults to '0' if not specified.