search #
Searches for notification rules.
Query Syntax #
HTTP #
[//]: # (URL: http://kuzzle:7512/notifications/:index/_search[?from=<int>][&size=<int>])
[//]: # (Method: POST)
[//]: # (Body:)
{
"query": {
// query
},
"aggregations": {
// ...
},
"sort": {
// sort
},
}
Javascript #
kuzzle.query({
controller: 'notifications',
action: 'search',
index: '<index>',
from: 0, // integer
size: 10, // integer
body: {
query: {
// query
},
sort: {
// sort
},
},
});
Arguments #
index
: Tenant indexfrom
: Offset of the first notification rule to fetchsize
: Maximum number of notification rules to fetch
Optional: #
query
: the search query itself, using the ElasticSearch Query DSLaggregations
: control how the search result should be aggregatedsort
: contains a list of fields, used to sort search results, in order of importance
Response #
Returns a list of notification rules.
{
"status": 200,
"error": null,
"controller": "notifications",
"action": "search",
"index": "<tenant-air_quality-kuzzle>",
"requestId": "<unique request identifier>",
"result": {
"total": 1,
"hits": [
{
"_id": "<notification rule id>",
"_score": 1,
"_source": {
// rule content
},
{
"_id": "<another notification rule id>",
"_score": 1,
"_source": {
// rule content
},
],
"total": 2
}
}
Edit this page on Github(opens new window)