Description

Field Name Required? Rules Description

@datatype

False

must be "GSearchRequest" if present

@version

False

must be "2017-09-01" if present

q

See note

String

User-supplied query, conforming to the query syntax

limit

False

Integer

Limit the results given to limit many items

offset

False

Integer

Start at the result numbered offset, in conjunction with limit allows result paging

facets

False

Array of GFacet Documents

Facets to count on the search

filters

See note

Array of GFilter Documents

Filters to apply to the search

boosts

False

Array of GBoost Documents

Fields to increase value in un-sorted searches

sort

False

Array of GSort Documents

Fields on which to sort returned values

resource_type

See note

String

Name of a resource_type

Short-hand for not only filtering on a resource_type, but also for including various builtin facets.

advanced

False

Boolean

Defaults to False

When true, interpret q with the advanced query syntax

Note:A GSearchRequest requires at least one of q, filters, or resource_type
Note:If sort is specified, boosts is ignored as results will be ordered based on sorting rather than relevance calculation which is influenced by boosts.

Examples

Example 1
{
  "q": "the quick brown fox jumps"
}
Example 2
{
  "q": "author: \"John Doe\"",
  "advanced": true,
  "limit": 5
}
Example 3
{
  "q": "a search with paging",
  "offset": 100,
  "limit": 100
}
Example 4
{
  "@datatype": "GSearchRequest",
  "q": "a search with filtering and faceting",
  "filters": [
    {
      "@datatype": "GFilter",
      "type": "range",
      "field_name": "path.to.date",
      "values": [
        {
          "from": "*",
          "to": "2014-11-07"
        }
      ]
    }
  ],
  "facets": [
    {
      "@datatype": "GFacet",
      "name": "Publication Date",
      "field_name": "path.to.date",
      "type": "date_histogram",
      "date_interval": "year"
    }
  ],
  "sort": [
    {
      "@datatype": "GSort",
      "field_name": "path.to.date",
      "order": "asc"
    }
  ]
}
Example 5
{
  "q": "(queries can be fancy AND cool) OR (NOT extravagant)",
  "advanced": true
}

© 2010- The University of Chicago Legal