Skip to main content

indexes

Operations on a indexes resource.

Overview

Nameindexes
TypeResource
Iddatabricks_workspace.vectorsearch.indexes

Fields

NameDatatype
namestring
creatorstring
delta_sync_index_specobject
endpoint_namestring
index_typestring
primary_keystring
statusobject

Methods

NameAccessible byRequired ParamsDescription
getindexSELECTindex_name, deployment_nameGet an index.
listindexesSELECTendpoint_name, deployment_nameList all indexes in the given endpoint.
createindexINSERTdeployment_nameCreate a new index.
deleteindexDELETEindex_name, deployment_nameDelete an index.
querynextpageEXECindex_name, deployment_nameUse
syncindexEXECindex_name, deployment_nameTriggers a synchronization process for a specified vector index.

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new indexes resource.

/*+ 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 }}'
;

DELETE example

Deletes a indexes resource.

/*+ delete */
DELETE FROM databricks_workspace.vectorsearch.indexes
WHERE index_name = '{{ index_name }}' AND
deployment_name = '{{ deployment_name }}';