1. Description

The Query Templates APIs are used to get the contents of supported Query Templates.

A Query Template is a pre-built GSearchRequest query document. The purpose of Query Templates is to specify sorting, faceting, and filtering rules which should be applied to a wide variety of similar searches.

Query Templates can help to encode expert-knowledge about the contents of an index, and store that information as an attribute of the index itself, rather than as information which needs to be shared amongst client applications.

2. Document Types

2.1. GQueryTemplate

A GQueryTemplate is a partial GSearchRequest, used to contain a facilitate the use and reuse of a set of parameters. GQueryTemplates are defined relative to specific indices

Field Name Type Description

name

True

String

Unique string name for this template

description

String

A description of the template

search_request

Object

Note:At present, adding a GQueryTemplate requires a request to the Globus Search team. APIs to manage templates are planned.

2.2. GQueryTemplateList

A GQueryTemplateList is list of GQueryTemplate documents.

Field Name Type Description

query_templates

Array

Array of GQueryTemplate docs

3. API Methods

3.1. GET Query Template

URL

/v1/index/<index_id>/query_template/<template_name>

Method

GET

Query Parameters

None

HTTP Headers

Authorization header optional

Request Body

None

Response Body

GQueryTemplate

Fetch the query template common_params for index c14e1b20-5006-4bd4-bfda-08e66ec16230:

curl -XGET 'https://search.api.globus.org/v1/index/c14e1b20-5006-4bd4-bfda-08e66ec16230/query_template/common_params'

3.2. GET Query Template List

URL

/v1/index/<index_id>/query_template

Method

GET

Query Parameters

None

HTTP Headers

Authorization header optional

Request Body

None

Response Body

GQueryTemplateList

Fetch all the query templates for index c14e1b20-5006-4bd4-bfda-08e66ec16230:

curl -XGET 'https://search.api.globus.org/v1/index/c14e1b20-5006-4bd4-bfda-08e66ec16230/query_template'

© 2010- The University of Chicago Legal