indexes
Operations on a indexes
resource.
Overview
Name | indexes |
Type | Resource |
Id | databricks_workspace.vectorsearch.indexes |
Fields
Name | Datatype |
---|---|
name | string |
creator | string |
delta_sync_index_spec | object |
endpoint_name | string |
index_type | string |
primary_key | string |
status | object |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
getindex | SELECT | index_name, deployment_name | Get an index. |
listindexes | SELECT | endpoint_name, deployment_name | List all indexes in the given endpoint. |
createindex | INSERT | deployment_name | Create a new index. |
deleteindex | DELETE | index_name, deployment_name | Delete an index. |
querynextpage | EXEC | index_name, deployment_name | Use |
syncindex | EXEC | index_name, deployment_name | Triggers a synchronization process for a specified vector index. |
SELECT
examples
- indexes (getindex)
- indexes (listindexes)
SELECT
name,
creator,
delta_sync_index_spec,
endpoint_name,
index_type,
primary_key,
status
FROM databricks_workspace.vectorsearch.indexes
WHERE index_name = '{{ index_name }}' AND
deployment_name = '{{ deployment_name }}';
SELECT
name,
creator,
delta_sync_index_spec,
endpoint_name,
index_type,
primary_key,
status
FROM databricks_workspace.vectorsearch.indexes
WHERE endpoint_name = '{{ endpoint_name }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new indexes
resource.
- indexes
- Manifest
/*+ create */
INSERT INTO databricks_workspace.vectorsearch.indexes (
deployment_name,
data__name,
data__primary_key,
data__index_type,
data__delta_sync_index_spec
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ primary_key }}',
'{{ index_type }}',
'{{ delta_sync_index_spec }}'
;
- name: your_resource_model_name
props:
- name: name
value: main_catalog.docs.en_wiki_index
- name: primary_key
value: id
- name: index_type
value: DELTA_SYNC
- name: delta_sync_index_spec
value:
source_table: main_catalog.docs.en_wiki
pipeline_type: TRIGGERED
embedding_source_columns:
- name: text
embedding_model_endpoint_name: e5-small-v2
columns_to_sync:
- id
- text
DELETE
example
Deletes a indexes
resource.
/*+ delete */
DELETE FROM databricks_workspace.vectorsearch.indexes
WHERE index_name = '{{ index_name }}' AND
deployment_name = '{{ deployment_name }}';