Description

Typically used as part of a GSearchRequest

Field Name Required? Rules Description

@datatype

False

must be "GFacet" if present

@version

False

must be "2017-09-01" if present

name

False

String

A name for this facet which is referenced in the results. If name is omitted, it will default to the value of the field_name property. If more than one facet in a single search request references the same field, a name must be provided.

type

True

String

One of {"terms", "date_histogram", "numeric_histogram"}

field_name

True

String

The field to which the facet refers. Any dots (".") must be escaped with a preceeding backslash ("\") character.

size

See note

Integer

For terms and numeric_histogram facets, the number of facet values (buckets) to return. For terms, this is the most common values (buckets with highest count). For numeric_histograms, this is the number of intervals between low and high of the histogram_range to be created

histogram_range

See note

Object

An object containing the following fields:

low: Numeric or date formatted String containing the low value bucket

high: Numeric or date formatted String containing the high value for the last bucket

date_interval

False

String

Must be one of: {"year", "quarter", "month", "week", "day", "hour", "minute", "second"}. May only be present when the type is "date_histogram". Indicates the unit for the buckets returned within the histogram_range

Note:histogram_range is required when type is "date_histogram" or "numeric_histogram"
Note:size is required when type is "numeric_histogram"
Note:For a terms facet, any values containing more than 10,000 characters will not be tabulated into the results and no buckets containing a value with more than 10,000 characters will be created.

Examples

Example 1
{
  "name": "File Extension",
  "type": "terms",
  "field_name": "extension",
  "size": 10
}
Example 2
{
  "name": "pub_date",
  "type": "date_histogram",
  "field_name": "http://dublincore\.org/schemas/xmls/qdc/2008/02/11/dcterms\.xsd#created",
  "histogram_range": {
    "low": "2000-01-01",
    "high": "2010-01-01",
  },
  "date_interval": "year"
}
Example 3
{
  "name": "file size",
  "type": "numeric_histogram",
  "field_name": "https://transfer\.api\.globus\.org/file#size",
  "size": 100,
  "histogram_range": {
    "low": 0,
    "high": 100000000,
  }
}
Example 4
{
  "type": "terms",
  "field_name": "https://transfer\.api\.globus\.org/endpoint#keywords"
}
Example 5
{
  "name": "resource type",
  "type": "terms",
  "field_name": "https://schema\.labs\.datacite\.org/meta/kernel-4\.0/metadata\.xsd#resourceTypeGeneral"
}

© 2010- The University of Chicago Legal