numeric
fun numeric(field: String, ranges: List<NumericRange>, size: Int = ranges.size, name: String = field): NumericFacet
Content copied to clipboard
Counts the search results whose value for field is within one of the pre-defined ranges.
Reports the size most populous ranges and their counts.
See also
Parameters
field
Name of the document field to inspect. The field must be indexed using the number
type.
size
Maximum number of categories to report.
ranges
Pre-defined categories to assign documents to, based on whether the field value matches one of the ranges.
name
An arbitrary name to assign to this facet. Can be used to identify the associated NumericFacetResult from the search response.