{
  "oc_search_api" : {
    "about" : "The Open Collections search API accepts GET requests with the following parameters, and POST requests using the ElasticSearch Query DSL format. More information at https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html",
    "elasticsearch_version" : "8.5",
    "endpoint_url" : "https://oc-index.library.ubc.ca/search/8.5",
    "parameters" : {
      "q" : {
        "description" : "query string",
        "default" : "*",
        "notes" : "Accepts basic string or boolean query (Lucene query syntax). Should be uri encoded.",
        "example" : "?q=cats"
      },
      "size" : {
        "description" : "number of responses",
        "default" : "20",
        "notes" : "",
        "example" : "&size=10"
      },
      "from" : {
        "description" : "index of first result",
        "default" : "0",
        "notes" : "used to paginate through results (ie. use '19' to return results starting with the 20th hit)",
        "example" : "&from=9"
      },
      "index" : {
        "description" : "search index",
        "default" : "oc",
        "notes" : "Used to limit search to specific collections (use collection 'nickname'). 'oc' searches all content. supports multiple values (comma-separated)",
        "example" : "&index=arkley"
      },
      "sort" : {
        "description" : "how to sort results",
        "default" : "_score,desc",
        "notes" : "Comma-separated: [:field],[:order]. Accepts '_score' and metadata field names, and 'asc'/'desc'",
        "example" : "&sort=ubc_date_sort,asc"
      },
      "term" : {
        "description" : "Filter by metadata field contents, must match ALL",
        "default" : "",
        "notes" : "Comma-separated: field,filter_on. Supports multiple value pairs separated by semicolons. Use [:field].raw to match full text of field value.",
        "example" : "&term=genre.raw,Newspapers;genre.raw,Books;subject.raw,Cats"
      },
      "terms" : {
        "description" : "Filter by metadata field contents, match ANY in a given field",
        "default" : "",
        "notes" : "Comma-separated: field,filter_on. Supports multiple value pairs separated by semicolons. Use [:field].raw to match full text of field value.",
        "example" : "&terms=genre.raw,Newspapers;genre.raw,Books;subject.raw,Cats;subject.raw,Dogs"
      },
      "range" : {
        "description" : "Limit to range of values for a metadata field",
        "default" : "",
        "notes" : "Comma-separated: field,gte,lte,date_format(date_format is optional. If not specified, the provided date will be matched with all available formats until a match is found). Only works on numeric fields: e.g. sortDate accepts milliseconds. Accepted date formats are: yyyy-MM-dd, yyyy-MM, Y, date_time_no_millis, date_hour_minute_second, epoch_millis",
        "example" : "&range=ubc_date_sort,-1961612307692,1405257872064,epoch_millis"
      },
      "source" : {
        "description" : "array of field names to return",
        "default" : "",
        "notes" : "Comma separated. If omitted a default set of metadata will be returned.",
        "example" : "&source=title,author,ubc_date_sort"
      },
      "key" : {
        "description" : "API key",
        "default" : "",
        "notes" : "Requests without an API key will be rate limited"
      }
    }
  }
}
