Skip to main content

indexes

Creates, updates, deletes, gets or lists an indexes resource.

Overview

Nameindexes
TypeResource
Idaws.clouddirectory.indexes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
indexed_attributesarrayThe indexed attribute values.
object_identifierstringIn response to ListIndex, the ObjectIdentifier of the object attached to the index. In response to ListAttachedIndices, the ObjectIdentifier of the index attached to the object. This field will always contain the ObjectIdentifier of the object on the opposite side of the attachment specified in the query.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_indexselectx-amz-data-partition, regionx-amz-consistency-levelLists objects attached to the specified index.
create_indexinsertx-amz-data-partition, region, OrderedIndexedAttributeList, IsUniqueCreates an index object. See Indexing and search for more information.
attach_to_indexupdatex-amz-data-partition, region, IndexReference, TargetReferenceAttaches the specified object to the specified index.
detach_from_indexexecx-amz-data-partition, region, IndexReference, TargetReferenceDetaches the specified object from the specified index.

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)
x-amz-data-partitionstringThe Amazon Resource Name (ARN) of the directory the index and object exist in.
x-amz-consistency-levelstringThe consistency level to execute the request at.

SELECT examples

Lists objects attached to the specified index.

SELECT
indexed_attributes,
object_identifier
FROM aws.clouddirectory.indexes
WHERE `x-amz-data-partition` = '{{ x-amz-data-partition }}' -- required
AND region = '{{ region }}' -- required
AND `x-amz-consistency-level` = '{{ x-amz-consistency-level }}'
;

INSERT examples

Creates an index object. See Indexing and search for more information.

INSERT INTO aws.clouddirectory.indexes (
OrderedIndexedAttributeList,
IsUnique,
ParentReference,
LinkName,
`x-amz-data-partition`,
region
)
SELECT
'{{ OrderedIndexedAttributeList }}' /* required */,
{{ IsUnique }} /* required */,
'{{ ParentReference }}',
'{{ LinkName }}',
'{{ x-amz-data-partition }}',
'{{ region }}'
RETURNING
object_identifier
;

UPDATE examples

Attaches the specified object to the specified index.

UPDATE aws.clouddirectory.indexes
SET
IndexReference = '{{ IndexReference }}',
TargetReference = '{{ TargetReference }}'
WHERE
`x-amz-data-partition` = '{{ x-amz-data-partition }}' --required
AND region = '{{ region }}' --required
AND IndexReference = '{{ IndexReference }}' --required
AND TargetReference = '{{ TargetReference }}' --required
RETURNING
attached_object_identifier;

Lifecycle Methods

Detaches the specified object from the specified index.

EXEC aws.clouddirectory.indexes.detach_from_index
@x-amz-data-partition='{{ x-amz-data-partition }}' --required,
@region='{{ region }}' --required
@@json=
'{
"IndexReference": "{{ IndexReference }}",
"TargetReference": "{{ TargetReference }}"
}'
;