Simple search query. Supports pagination.
The query string is expected to be a valid Elastic Search query string.name | type | description | default | constraints |
---|---|---|---|---|
defaultoperator | query | the default boolean operator to use on terms in the search query (optional) | OR | |
fields | query | comma-separated list of fields to include in each result record (optional).
To exclude a field, prepend a minus to a field name; use no prefix to include it.
|
||
from | query | the first result to include (optional) | int | |
limit | query | alias of size (optional) |
-1 | int |
offset | query | alias of from (optional) |
0 | int |
q | query | search query to run | * | |
size | query | the number of results to return, -1 for default page size (optional) | int | |
sort | query | the field and order to sort on (optional).
To sort in descending order, prepend a minus to the field name. Examples:
|
code | condition |
---|---|
400 | The search query is syntactically incorrect. |
422 | The pagination size limit is exceeded. |
media type | data type | description |
---|---|---|
application/json;profiles=tepapa.collections.api.v1 | object |
GET /search
Content-Type: */*
Accept: application/json;profiles=tepapa.collections.api.v1
...
HTTP/1.1 200 OK
Content-Type: application/json;profiles=tepapa.collections.api.v1
...
Advanced search query. Supports pagination.
The query string is expected to be a valid Elastic Search query string.media type | data type |
---|---|
application/json | ApiSearchRequest (JSON) |
code | condition |
---|---|
200 | The search query was executed successfully. |
400 | The search query is syntactically incorrect. |
422 | The pagination size limit is exceeded. |
media type | data type | description |
---|---|---|
application/json;profiles=tepapa.collections.api.v1 | object | ApiSearchResult |
POST /search
Content-Type: application/json
Accept: application/json;profiles=tepapa.collections.api.v1
{
"query" : "James Cook",
"defaultOperator" : "AND",
"from" : 25,
"size" : 10,
"fields" : [ {
"include" : true,
"field" : "title",
"exclude" : true
}, {
"include" : true,
"field" : "_meta.*",
"exclude" : false
} ],
"facets" : [ {
"field" : "birthPlace",
"size" : 3
}, {
"field" : "birthDate",
"size" : 5
} ],
"filters" : [ {
"field" : "birthPlace",
"keyword" : "London"
}, {
"field" : "birthDate",
"keyword" : "1987"
} ],
"sort" : [ {
"field" : "title",
"order" : "asc"
}, {
"field" : "_meta.modified",
"order" : "desc"
} ]
}
HTTP/1.1 200 OK
Content-Type: application/json;profiles=tepapa.collections.api.v1
...
Start a scroll for bulk data retrieval. The resulting temporary resource will be available for up to the given amount of time.
A scroll request is very similar to a search request, but instead of allowing to specify pagination, a Location and Link header is returned with the unique, temporary URI to the next page.name | type | description | default | constraints |
---|---|---|---|---|
defaultoperator | query | the default boolean operator to use on terms in the search query (optional) | OR | |
duration | query | the duration this scroll should be available for in minutes | 1 | required |
fields | query | list of fields to include in each result record (optional) | ||
q | query | search query to run (optional) | * | |
size | query | the size of each individual scroll response (optional) | 1000 | required |
code | condition |
---|---|
303 | The scroll was initiated. See Location or Link header for the next temporary scroll location. |
400 | The search query is syntactically incorrect. |
422 | The scroll duration limit is exceeded. |
media type | data type | description |
---|---|---|
application/json;profiles=tepapa.collections.api.v1 | object |
POST /search/_scroll
Content-Type: */*
Accept: application/json;profiles=tepapa.collections.api.v1
...
HTTP/1.1 303 See Other
Content-Type: application/json;profiles=tepapa.collections.api.v1
...