Skip to main content

search_results

Creates, updates, deletes, gets or lists a search_results resource.

Overview

Namesearch_results
TypeResource
Idaws.iotsitewise.search_results

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
dataset_idstringThe identifier of the dataset that contains the matching data. (pattern: <code>^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>)
end_timestampobjectContains a timestamp with optional nanosecond granularity.
scorenumber (float)The relevance score of this result. Higher scores indicate a stronger match.
search_idstringThe unique identifier of a search, assigned by the service when the search is started. (pattern: <code>[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*</code>)
start_timestampobjectContains a timestamp with optional nanosecond granularity.
time_series_idstringThe identifier of the time series that contains the matching data.
top_timestampobjectContains a timestamp with optional nanosecond granularity.
workspace_namestringThe name of the workspace the search ran against. (pattern: <code>^[a-zA-Z0-9_-]+$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_search_resultsselectsearch_id, workspace_name, regionmaxResults, nextTokenRetrieves 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
search_idstringThe identifier of the search whose results are retrieved.
workspace_namestringThe name of the workspace the search belongs to.
maxResultsintegerThe 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.
nextTokenstringThe pagination token returned by a previous GetSearchResults call. Provide it to retrieve the next page of results; omit it to retrieve the first page.

SELECT examples

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.

SELECT
dataset_id,
end_timestamp,
score,
search_id,
start_timestamp,
time_series_id,
top_timestamp,
workspace_name
FROM aws.iotsitewise.search_results
WHERE search_id = '{{ search_id }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;