Elasticsearch API
To search Gallery data, use our Elasticsearch-based API.
Query syntax
To query data, send an HTTP GET request to https://data.ng.ac.uk/es/public/_search? with a JSON payload that uses the query syntax for Elasticsearch version 7.17.
Returned data
The API will return JSON data formatted according to our CIIM middleware's standard JSON structure. The structure is extensive and complex, so some sample queries are provided below. We have also published the full data standard (this is very much a work in progress, so please bear with us); paths to individual fields in the JSON are denoted using JsonPath syntax.
You can find some sample JSON records on our JSON examples page.
Sample queries
Return the full record for the object with accession number NG35:
{
"query": {
"bool": {
"must": [{
"match": {
"identifier.value": "NG35"
}
}, {
"match": {
"@datatype.base": "object"
}
}
]
}
}
}
Return all objects attributed to Titian:
{
"query": {
"bool": {
"must": [{
"match": {
"creation.maker.summary.title": "Titian"
}
}, {
"match": {
"@datatype.base": "object"
}
}
]
}
}
}
Return only records for objects:
{
"query": {
"bool": {
"filter": {
"term": {
"@datatype.base": "object"
}
}
}
}
}
Return only the PIDs for all objects:
{
"_source": {
"includes": [
"@admin.uid"
]
},
"query": {
"bool": {
"filter": {
"term": {
"@datatype.base": "object"
}
}
}
}
}
Return a list of all entity types with the relevant number of records:
{
"size": 0,
"aggs": {
"bases": {
"terms": {
"field": "@datatype.base"
}
}
}
}
Query URLs
Some queries can also be submitted within a URL, for example:
https://data.ng.ac.uk/es/public/_search?q=@datatype.base:%22object%22&_source=%22@admin.uid%22
Note the use of the _q and _source parameters.
Re-use licences
The Gallery's data is made available for reuse under specific licences; for more information see Licences.