searchSpecifications #
Searches collection specifications.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/validations/_search[?from=0][&size=10][&scroll=<time to live>]
Method: POST
Body:
{
// A set of filters or queries matching documents you are looking for.
"query": {
...
}
}
Other protocols #
{
"controller": "collection",
"action": "searchSpecifications",
"body": {
"query": {
"Some": "filters"
}
},
"from": 0,
"size": 42,
"scroll": "<time to live>"
}
Arguments #
collection
: collection nameindex
: index name
Optional: #
from
is usually used with thesize
argument, and defines the offset from the first result you want to fetchscroll
is used to fetch large result sets, and it must be set with a time duration. If set, a forward-only cursor will be created (and automatically destroyed at the end of the set duration), and its identifier will be returned in thescrollId
property, along with the first page of the results. This cursor can then be moved forward using thescrollSpecifications
API actionsize
controls the maximum number of documents returned in the response
Body properties #
Optional: #
query
: a search query filtering the result, using the ElasticSearch Query DSL
Response #
Returns an object containing the following properties:
hits
: an array of found documents. Each item is an object with the following properties:_id
: specification unique identifier_score
: search pertinence score_source
: validation specification
scrollId
: the cursor unique identifier for the next page of results. Present only if thescroll
argument has been settotal
: the total number of found specifications (usually greater than the number of items in thehits
array)
Example:
{
"status": 200,
"error": null,
"action": "scrollSpecifications",
"controller": "collection",
"requestId": "<unique request identifier>",
"result": {
"scrollId": "<new scroll id>",
"hits": [
{
"_id": "<specification unique ID>",
"_score": 1,
"_source": {
"collection": "myCollection",
"index": "myIndex",
"validation": {
"fields": {
"fieldName": {
"defaultValue": "a default value",
"mandatory": true,
"multivalued": {
"maxCount": 5,
"minCount": 1,
"value": true
},
"type": "string",
"typeOptions": {
"length": {
"max": 12,
"min": 2
}
}
}
},
"strict": true
}
}
}
],
"total": 42
}
}
Possible errors #
Edit this page on Github (opens new window)