GetSearchResults
Retrieves the ranked results of a search, ordered by descending relevance score. Results are available only after the search has reached the SUCCEEDED status. Calling this on a search that exists but has not yet completed returns InvalidRequestException, while calling it on a search that does not exist returns ResourceNotFoundException. The response is paginated: when nextToken is present, pass it on a subsequent call to retrieve the next page.
Request Syntax
GET /workspaces/workspaceName/searches/searchId/results?maxResults=maxResults&nextToken=nextToken HTTP/1.1
URI Request Parameters
The request uses the following URI parameters.
- maxResults
-
The maximum number of results to return in a single page. Valid range is 1 to 10,000; if omitted, a service-defined default is used.
Valid Range: Minimum value of 1. Maximum value of 10000.
- nextToken
-
The pagination token returned by a previous GetSearchResults call. Provide it to retrieve the next page of results; omit it to retrieve the first page.
Length Constraints: Minimum length of 1. Maximum length of 4096.
Pattern:
[A-Za-z0-9+/=]+ - searchId
-
The identifier of the search whose results are retrieved.
Length Constraints: Minimum length of 23. Maximum length of 36.
Pattern:
[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*Required: Yes
- workspaceName
-
The name of the workspace the search belongs to.
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
^[a-zA-Z0-9_-]+$Required: Yes
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"nextToken": "string",
"searchResults": [
{
"datasetId": "string",
"endTimestamp": {
"offsetInNanos": number,
"timeInSeconds": number
},
"score": number,
"searchId": "string",
"startTimestamp": {
"offsetInNanos": number,
"timeInSeconds": number
},
"timeSeriesId": "string",
"topTimestamp": {
"offsetInNanos": number,
"timeInSeconds": number
},
"workspaceName": "string"
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- nextToken
-
The pagination token to use in a subsequent GetSearchResults call to retrieve the next page. Absent when there are no more results.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 4096.
Pattern:
[A-Za-z0-9+/=]+ - searchResults
-
A page of search results, ordered by descending relevance score.
Type: Array of SearchResult objects
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
Access is denied.
HTTP Status Code: 403
- InternalFailureException
-
AWS IoT SiteWise can't process your request right now. Try again later.
HTTP Status Code: 500
- InvalidRequestException
-
The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.
HTTP Status Code: 400
- ResourceNotFoundException
-
The requested resource can't be found.
HTTP Status Code: 404
- ThrottlingException
-
Your request exceeded a rate limit. For example, you might have exceeded the number of AWS IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.
For more information, see Quotas in the AWS IoT SiteWise User Guide.
HTTP Status Code: 429
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: