date
fun date(field: String, ranges: List<DateRange>, size: Int = ranges.size, name: String = field): DateFacet
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 datetime
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 DateFacetResult from the search response.