Description

Typically used as part of a GSearchRequest

Field Name Required? Rules Description

@datatype

False

must be "GFilter" if present

@version

False

must be "2017-09-01" if present

type

True

String

One of {"match_any", "match_all", "range"}

field_name

True

String

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

values

True

Array of Strings or Objects

The values to evaluate against the field_name.

If type is "match_any" or "match_all" this must be a list of Strings.

If type is "range", this must be a list of Objects each with the fields from and to.

"match_any" and "match_all" refer to the different possible behaviors of the filter values. As their names imply, if "match_any" is specified, the filter will match results for which any of filter values match, while "match_all" requires that all of the values match on every result.

Note:

"match_any" and "match_all" are the same when there’s only one value as far as filtering is concerned, but they may have different impact on the way that facets are interpreted.

Note:

values.from and values.to may be the special string "*" indicating that the range is unbounded on this end. An example is given below.

Examples

Example 1
{
  "@datatype": "GFilter",
  "@version": "2017-09-01",
  "type": "match_any",
  "field_name":
"https://schema\.labs\.datacite\.org/meta/kernel-4\.0/metadata\.xsd#resourceTypeGeneral",
  "values": ["Globus Endpoint"]
}
Example 2
{
  "type": "range",
  "field_name": "path.to.date",
  "values": [
    {
      "low": "1970-01-01",
      "high": "2015-01-01"
    }
  ]
}
Example 3
{
  "type": "range",
  "field_name": "path.to.date",
  "values": [
    {
      "low": "*",
      "high": "2014-11-07"
    }
  ]
}
Example 4
{
  "type": "match_all",
  "field_name": "https://transfer\.api\.globus\.org/endpoint#keywords",
  "values": ["hpc", "internet2", "uchicago"]
}

© 2010- The University of Chicago Legal