Skip to main content

indexes

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

Overview

Nameindexes
TypeResource
Iddatabricks_workspace.vectorsearch.indexes

Fields

The following fields are returned by SELECT queries:

Successful response with details of the index

NameDatatypeDescription
namestring
endpoint_namestring
creatorstring
delta_sync_index_specobject
index_typestring
primary_keystring
statusobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getindexselectdeployment_nameGet an index.
listindexesselectdeployment_nameList all indexes in the given endpoint.
createindexinsertdeployment_nameCreate a new index.
deleteindexdeletedeployment_nameDelete an index.
querynextpageexecdeployment_nameUse
syncindexexecdeployment_nameTriggers a synchronization process for a specified vector 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
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Get an index.

SELECT
name,
endpoint_name,
creator,
delta_sync_index_spec,
index_type,
primary_key,
status
FROM databricks_workspace.vectorsearch.indexes
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Create a new index.

INSERT INTO databricks_workspace.vectorsearch.indexes (
data__name,
data__endpoint_name,
data__primary_key,
data__index_type,
data__delta_sync_index_spec,
data__direct_access_index_spec,
deployment_name
)
SELECT
'{{ name }}',
'{{ endpoint_name }}',
'{{ primary_key }}',
'{{ index_type }}',
'{{ delta_sync_index_spec }}',
'{{ direct_access_index_spec }}',
'{{ deployment_name }}'
RETURNING
name,
endpoint_name,
creator,
delta_sync_index_spec,
index_type,
primary_key,
status
;

DELETE examples

Delete an index.

DELETE FROM databricks_workspace.vectorsearch.indexes
WHERE deployment_name = '{{ deployment_name }}' --required;

Lifecycle Methods

Use

EXEC databricks_workspace.vectorsearch.indexes.querynextpage 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"endpoint_name": "{{ endpoint_name }}",
"page_token": "{{ page_token }}"
}';