indexes
Creates, updates, deletes, gets or lists an indexes resource.
Overview
| Name | indexes |
| Type | Resource |
| Id | cloudflare.vectorize.indexes |
Fields
The following fields are returned by SELECT queries:
- query_v2
Query Vectors Response
| Name | Datatype | Description |
|---|---|---|
errors | array | |
messages | array | |
result | object | |
success | boolean | Whether the API call was successful (true) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
query_v2 | select | account_id, index_name | Finds vectors closest to a given vector in an index. | |
update_index | exec | account_id, index_name, description | Updates and returns the specified Vectorize Index. | |
create_delete_by_ids | exec | account_id, index_name | Delete a set of vectors from an index by their vector identifiers. | |
get_by_ids | exec | account_id, index_name | Get a set of vectors from an index by their vector identifiers. | |
create_insert | exec | account_id, index_name | Inserts vectors into the specified index and returns the count of the vectors successfully inserted. | |
query | exec | account_id, index_name, vector | Finds vectors closest to a given vector in an index. | |
upsert | exec | account_id, index_name | Upserts vectors into the specified index, creating them if they do not exist and returns the count of values and ids successfully inserted. | |
create_delete_by_ids_v2 | exec | account_id, index_name | Delete a set of vectors from an index by their vector identifiers. | |
get_by_ids_v2 | exec | account_id, index_name | Get a set of vectors from an index by their vector identifiers. | |
create_insert_v2 | exec | account_id, index_name | unparsable-behavior | Inserts vectors into the specified index and returns a mutation id corresponding to the vectors enqueued for insertion. |
upsert_v2 | exec | account_id, index_name | unparsable-behavior | Upserts vectors into the specified index, creating them if they do not exist and returns a mutation id corresponding to the vectors enqueued for upsertion. |
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 |
|---|---|---|
account_id | string | The Cloudflare account ID. |
index_name | string | The Vectorize index name. |
unparsable-behavior | string |
SELECT examples
- query_v2
Finds vectors closest to a given vector in an index.
SELECT
errors,
messages,
result,
success
FROM cloudflare.vectorize.indexes
WHERE account_id = '{{ account_id }}' -- required
AND index_name = '{{ index_name }}' -- required
;
Lifecycle Methods
- update_index
- create_delete_by_ids
- get_by_ids
- create_insert
- query
- upsert
- create_delete_by_ids_v2
- get_by_ids_v2
- create_insert_v2
- upsert_v2
Updates and returns the specified Vectorize Index.
EXEC cloudflare.vectorize.indexes.update_index
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required
@@json=
'{
"description": "{{ description }}"
}'
;
Delete a set of vectors from an index by their vector identifiers.
EXEC cloudflare.vectorize.indexes.create_delete_by_ids
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required
@@json=
'{
"ids": "{{ ids }}"
}'
;
Get a set of vectors from an index by their vector identifiers.
EXEC cloudflare.vectorize.indexes.get_by_ids
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required
@@json=
'{
"ids": "{{ ids }}"
}'
;
Inserts vectors into the specified index and returns the count of the vectors successfully inserted.
EXEC cloudflare.vectorize.indexes.create_insert
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required
;
Finds vectors closest to a given vector in an index.
EXEC cloudflare.vectorize.indexes.query
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required
@@json=
'{
"filter": "{{ filter }}",
"returnMetadata": {{ returnMetadata }},
"returnValues": {{ returnValues }},
"topK": {{ topK }},
"vector": "{{ vector }}"
}'
;
Upserts vectors into the specified index, creating them if they do not exist and returns the count of values and ids successfully inserted.
EXEC cloudflare.vectorize.indexes.upsert
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required
;
Delete a set of vectors from an index by their vector identifiers.
EXEC cloudflare.vectorize.indexes.create_delete_by_ids_v2
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required
@@json=
'{
"ids": "{{ ids }}"
}'
;
Get a set of vectors from an index by their vector identifiers.
EXEC cloudflare.vectorize.indexes.get_by_ids_v2
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required
@@json=
'{
"ids": "{{ ids }}"
}'
;
Inserts vectors into the specified index and returns a mutation id corresponding to the vectors enqueued for insertion.
EXEC cloudflare.vectorize.indexes.create_insert_v2
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required,
@unparsable-behavior='{{ unparsable-behavior }}'
;
Upserts vectors into the specified index, creating them if they do not exist and returns a mutation id corresponding to the vectors enqueued for upsertion.
EXEC cloudflare.vectorize.indexes.upsert_v2
@account_id='{{ account_id }}' --required,
@index_name='{{ index_name }}' --required,
@unparsable-behavior='{{ unparsable-behavior }}'
;