indexes
Creates, updates, deletes, gets or lists an indexes resource.
Overview
| Name | indexes |
| Type | Resource |
| Id | aws.clouddirectory.indexes |
Fields
The following fields are returned by SELECT queries:
- list_index
| Name | Datatype | Description |
|---|---|---|
indexed_attributes | array | The indexed attribute values. |
object_identifier | string | In 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_index | select | x-amz-data-partition, region | x-amz-consistency-level | Lists objects attached to the specified index. |
create_index | insert | x-amz-data-partition, region, OrderedIndexedAttributeList, IsUnique | Creates an index object. See Indexing and search for more information. | |
attach_to_index | update | x-amz-data-partition, region, IndexReference, TargetReference | Attaches the specified object to the specified index. | |
detach_from_index | exec | x-amz-data-partition, region, IndexReference, TargetReference | Detaches 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
x-amz-data-partition | string | The Amazon Resource Name (ARN) of the directory the index and object exist in. |
x-amz-consistency-level | string | The consistency level to execute the request at. |
SELECT examples
- list_index
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
- create_index
- Manifest
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
;
# Description fields are for documentation purposes
- name: indexes
props:
- name: x-amz-data-partition
value: "{{ x-amz-data-partition }}"
description: Required parameter for the indexes resource.
- name: region
value: "{{ region }}"
description: Required parameter for the indexes resource.
- name: OrderedIndexedAttributeList
value:
- SchemaArn: "{{ SchemaArn }}"
FacetName: "{{ FacetName }}"
Name: "{{ Name }}"
- name: IsUnique
value: {{ IsUnique }}
- name: ParentReference
description: |
The reference that identifies an object.
value:
Selector: "{{ Selector }}"
- name: LinkName
value: "{{ LinkName }}"
UPDATE examples
- attach_to_index
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
- detach_from_index
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 }}"
}'
;