searchAssets #
Searches for asset models.
By default, the metadata of the metadata referential used by the models are resolved: their { "referential": true } marker in metadataMappings is replaced by the referential mappings, and their metadataDetails and defaultMetadata are merged over the current referential values. Use rawModel to get the stored documents as is.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/device-manager/models/assets/_search
Method: POSTOther protocols #
{
"controller": "device-manager/models",
"action": "searchAssets",
"tenantClasses": ["<tenant class>"],
"body": {
"query": {
// ...
},
"sort": [
// ...
]
},
// optional:
"from": "<starting offset>",
"size": "<page size>",
"index": "<index>"
}Arguments #
tenantClasses: names of the tenant classesfrom: paginates search results by defining the offset from the first result you want to fetch. Usually used with thesizeargumentsize: set the maximum number of documents returned per result pageindex: optional. Engine ID (tenant ID) to filter models for. When provided, results include models scoped to that specific tenant, models scoped to the tenant class, and commons models (3-level fallback). When absent, only class-scoped and commons models are returned.rawModel: optional,falseby default. Iftrue, returns the stored models without resolving their referential metadata
Body properties #
query: the search query itself, using the ElasticSearch Query DSL.sort: contains a list of fields, used to sort search results, in order of importance.
Response #
{
"status": 200,
"error": null,
"controller": "device-manager/models",
"action": "searchAssets",
"requestId": "<unique request identifier>",
"result": {
"hits": [
{
"_id": "<assetModelId>",
"_source": {
// Asset model content
},
},
],
"total": 42
}
}