Skip to main content

indexes

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

Overview

Nameindexes
TypeResource
Iddatabricks_workspace.aisearch.indexes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringName of the AI Search index. Server-assigned full resource path (``workspaces/{workspace}/endpoints/{endpoint}/indexes/{index}``) on output, where ``{index}`` is the index's Unity Catalog table name. On create, the user-supplied UC table name is conveyed via ``CreateIndexRequest.index_id``; the server composes the full ``name`` and returns it on the response.
creatorstringCreator of the index.
delta_sync_index_specobjectSpecification for a Delta Sync index. Set when ``index_type`` is ``DELTA_SYNC``.
direct_access_index_specobjectSpecification for a Direct Access index. Set when ``index_type`` is ``DIRECT_ACCESS``.
endpointstringName of the endpoint associated with the index. Ignored on create — the endpoint is taken from ``CreateIndexRequest.parent``; populated only on output.
index_subtypestringThe subtype of the index. Set on create and immutable thereafter. (FULL_TEXT, HYBRID, VECTOR)
index_typestringType of index. Required on create and immutable thereafter. (DELTA_SYNC, DIRECT_ACCESS)
primary_keystringPrimary key of the index. Set on create and immutable thereafter.
statusobjectCurrent status of the index.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectparent, deployment_namedebug_level, page_size, page_tokenList AI Search indexes on an endpoint.
getselectname, deployment_nameGet details for a single AI Search index.
createinsertparent, deployment_name, indexindex_idCreate a new AI Search index.
deletedeletename, deployment_nameDelete an AI Search index.
queryexecname, deployment_name, columnsQuery (search) an AI Search index. Read-only, so a read-scoped token may invoke it.
remove_dataexecname, deployment_name, primary_keysRemove rows by primary key from a Direct Access AI Search index.
scanexecname, deployment_nameScan (paginate over) the rows of an AI Search index.
syncexecname, deployment_nameSynchronize a Delta Sync AI Search index with its source Delta table. Applies only to Delta Sync
upsert_dataexecname, deployment_name, inputs_jsonUpsert rows into a Direct Access AI Search 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)
namestringFull resource name of the index. Must be a Direct Access index. Format: workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}
parentstringThe Endpoint where this Index will be created. Format: workspaces/{workspace_id}/endpoints/{endpoint_id}
debug_levelintegerOpt-in debug level. When set to 1 or higher, the backend computes per-index routing eligibility and populates can_use_optimized_route on each returned index. When unset (0), that field is left unpopulated and the eligibility computation is skipped. Matches the debug_level convention on the query path.
index_idstringThe user-supplied Unity Catalog table name for the Index, per AIP-133. The server composes the full Index.name as {parent}/indexes/{index_id}. AIP-133 does not list index_id as a fields-may-be-required entry, so we annotate it OPTIONAL on the wire; the server still rejects empty values with INVALID_PARAMETER_VALUE.
page_sizeintegerBest-effort upper bound on the number of results to return. Honored as an upper bound by the shim: page_size only narrows the legacy backend's response, never widens it, so the practical cap is min(page_size, legacy_fixed_page_size).
page_tokenstringPage token from a previous response. If not provided, returns the first page.

SELECT examples

List AI Search indexes on an endpoint.

SELECT
name,
creator,
delta_sync_index_spec,
direct_access_index_spec,
endpoint,
index_subtype,
index_type,
primary_key,
status
FROM databricks_workspace.aisearch.indexes
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND debug_level = '{{ debug_level }}'
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;

INSERT examples

Create a new AI Search index.

INSERT INTO databricks_workspace.aisearch.indexes (
index,
parent,
deployment_name,
index_id
)
SELECT
'{{ index }}' /* required */,
'{{ parent }}',
'{{ deployment_name }}',
'{{ index_id }}'
RETURNING
name,
creator,
delta_sync_index_spec,
direct_access_index_spec,
endpoint,
index_subtype,
index_type,
primary_key,
status
;

DELETE examples

Delete an AI Search index.

DELETE FROM databricks_workspace.aisearch.indexes
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;

Lifecycle Methods

Query (search) an AI Search index. Read-only, so a read-scoped token may invoke it.

EXEC databricks_workspace.aisearch.indexes.query
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"columns": "{{ columns }}",
"columns_to_rerank": "{{ columns_to_rerank }}",
"facets": "{{ facets }}",
"filters_json": "{{ filters_json }}",
"max_results": {{ max_results }},
"query_columns": "{{ query_columns }}",
"query_text": "{{ query_text }}",
"query_type": "{{ query_type }}",
"query_vector": "{{ query_vector }}",
"reranker": "{{ reranker }}",
"score_threshold": {{ score_threshold }},
"sort_columns": "{{ sort_columns }}"
}'
;