IoT / Client / search_index

search_index#

IoT.Client.search_index(**kwargs)#

The query search index.

Requires permission to access the SearchIndex action.

See also: AWS API Documentation

Request Syntax

response = client.search_index(
    indexName='string',
    queryString='string',
    nextToken='string',
    maxResults=123,
    queryVersion='string'
)
Parameters:
  • indexName (string) – The search index name.

  • queryString (string) –

    [REQUIRED]

    The search query string. For more information about the search query syntax, see Query syntax.

  • nextToken (string) – The token used to get the next set of results, or null if there are no additional results.

  • maxResults (integer) – The maximum number of results to return per page at one time. This maximum number cannot exceed 100. The response might contain fewer results but will never contain more. You can use nextToken to retrieve the next set of results until nextToken returns NULL.

  • queryVersion (string) – The query version.

Return type:

dict

Returns:

Response Syntax

{
    'nextToken': 'string',
    'things': [
        {
            'thingName': 'string',
            'thingId': 'string',
            'thingTypeName': 'string',
            'thingGroupNames': [
                'string',
            ],
            'attributes': {
                'string': 'string'
            },
            'shadow': 'string',
            'deviceDefender': 'string',
            'connectivity': {
                'connected': True|False,
                'timestamp': 123,
                'disconnectReason': 'string'
            }
        },
    ],
    'thingGroups': [
        {
            'thingGroupName': 'string',
            'thingGroupId': 'string',
            'thingGroupDescription': 'string',
            'attributes': {
                'string': 'string'
            },
            'parentGroupNames': [
                'string',
            ]
        },
    ]
}

Response Structure

  • (dict) –

    • nextToken (string) –

      The token used to get the next set of results, or null if there are no additional results.

    • things (list) –

      The things that match the search query.

      • (dict) –

        The thing search index document.

        • thingName (string) –

          The thing name.

        • thingId (string) –

          The thing ID.

        • thingTypeName (string) –

          The thing type name.

        • thingGroupNames (list) –

          Thing group names.

          • (string) –

        • attributes (dict) –

          The attributes.

          • (string) –

            • (string) –

        • shadow (string) –

          The unnamed shadow and named shadow.

          For more information about shadows, see IoT Device Shadow service.

        • deviceDefender (string) –

          Contains Device Defender data.

          For more information about Device Defender, see Device Defender.

        • connectivity (dict) –

          Indicates whether the thing is connected to the Amazon Web Services IoT Core service.

          • connected (boolean) –

            True if the thing is connected to the Amazon Web Services IoT Core service; false if it is not connected.

          • timestamp (integer) –

            The epoch time (in milliseconds) when the thing last connected or disconnected. If the thing has been disconnected for approximately an hour, the time value might be missing.

          • disconnectReason (string) –

            The reason why the client is disconnected. If the thing has been disconnected for approximately an hour, the disconnectReason value might be missing.

    • thingGroups (list) –

      The thing groups that match the search query.

      • (dict) –

        The thing group search index document.

        • thingGroupName (string) –

          The thing group name.

        • thingGroupId (string) –

          The thing group ID.

        • thingGroupDescription (string) –

          The thing group description.

        • attributes (dict) –

          The thing group attributes.

          • (string) –

            • (string) –

        • parentGroupNames (list) –

          Parent group names.

          • (string) –

Exceptions

  • IoT.Client.exceptions.InvalidRequestException

  • IoT.Client.exceptions.ThrottlingException

  • IoT.Client.exceptions.UnauthorizedException

  • IoT.Client.exceptions.ServiceUnavailableException

  • IoT.Client.exceptions.InternalFailureException

  • IoT.Client.exceptions.ResourceNotFoundException

  • IoT.Client.exceptions.InvalidQueryException

  • IoT.Client.exceptions.IndexNotReadyException