indexes
Creates, updates, deletes, gets or lists an indexes resource.
Overview
| Name | indexes |
| Type | Resource |
| Id | databricks_workspace.aisearch.indexes |
Fields
The following fields are returned by SELECT queries:
- list
- get
| Name | Datatype | Description |
|---|---|---|
name | string | Name 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. |
creator | string | Creator of the index. |
delta_sync_index_spec | object | Specification for a Delta Sync index. Set when ``index_type`` is ``DELTA_SYNC``. |
direct_access_index_spec | object | Specification for a Direct Access index. Set when ``index_type`` is ``DIRECT_ACCESS``. |
endpoint | string | Name of the endpoint associated with the index. Ignored on create — the endpoint is taken from ``CreateIndexRequest.parent``; populated only on output. |
index_subtype | string | The subtype of the index. Set on create and immutable thereafter. (FULL_TEXT, HYBRID, VECTOR) |
index_type | string | Type of index. Required on create and immutable thereafter. (DELTA_SYNC, DIRECT_ACCESS) |
primary_key | string | Primary key of the index. Set on create and immutable thereafter. |
status | object | Current status of the index. |
| Name | Datatype | Description |
|---|---|---|
name | string | Name 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. |
creator | string | Creator of the index. |
delta_sync_index_spec | object | Specification for a Delta Sync index. Set when ``index_type`` is ``DELTA_SYNC``. |
direct_access_index_spec | object | Specification for a Direct Access index. Set when ``index_type`` is ``DIRECT_ACCESS``. |
endpoint | string | Name of the endpoint associated with the index. Ignored on create — the endpoint is taken from ``CreateIndexRequest.parent``; populated only on output. |
index_subtype | string | The subtype of the index. Set on create and immutable thereafter. (FULL_TEXT, HYBRID, VECTOR) |
index_type | string | Type of index. Required on create and immutable thereafter. (DELTA_SYNC, DIRECT_ACCESS) |
primary_key | string | Primary key of the index. Set on create and immutable thereafter. |
status | object | Current status of the index. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | parent, deployment_name | debug_level, page_size, page_token | List AI Search indexes on an endpoint. |
get | select | name, deployment_name | Get details for a single AI Search index. | |
create | insert | parent, deployment_name, index | index_id | Create a new AI Search index. |
delete | delete | name, deployment_name | Delete an AI Search index. | |
query | exec | name, deployment_name, columns | Query (search) an AI Search index. Read-only, so a read-scoped token may invoke it. | |
remove_data | exec | name, deployment_name, primary_keys | Remove rows by primary key from a Direct Access AI Search index. | |
scan | exec | name, deployment_name | Scan (paginate over) the rows of an AI Search index. | |
sync | exec | name, deployment_name | Synchronize a Delta Sync AI Search index with its source Delta table. Applies only to Delta Sync | |
upsert_data | exec | name, deployment_name, inputs_json | Upsert 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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
name | string | Full resource name of the index. Must be a Direct Access index. Format: workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id} |
parent | string | The Endpoint where this Index will be created. Format: workspaces/{workspace_id}/endpoints/{endpoint_id} |
debug_level | integer | Opt-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_id | string | The 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_size | integer | Best-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_token | string | Page token from a previous response. If not provided, returns the first page. |
SELECT examples
- list
- get
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 }}'
;
Get details for a single AI Search index.
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 name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: indexes
props:
- name: parent
value: "{{ parent }}"
description: Required parameter for the indexes resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the indexes resource.
- name: index
description: |
The Index resource to create. Fields other than ``index.name`` carry the desired configuration; ``index.name`` is server-assigned from ``parent`` and ``index_id``.
value:
primary_key: "{{ primary_key }}"
index_type: "{{ index_type }}"
creator: "{{ creator }}"
delta_sync_index_spec:
pipeline_type: "{{ pipeline_type }}"
columns_to_sync:
- "{{ columns_to_sync }}"
embedding_source_columns:
- embedding_model_endpoint: "{{ embedding_model_endpoint }}"
model_endpoint_name_for_query: "{{ model_endpoint_name_for_query }}"
name: "{{ name }}"
embedding_vector_columns:
- embedding_dimension: {{ embedding_dimension }}
name: "{{ name }}"
embedding_writeback_table: "{{ embedding_writeback_table }}"
pipeline_id: "{{ pipeline_id }}"
source_table: "{{ source_table }}"
direct_access_index_spec:
embedding_source_columns:
- embedding_model_endpoint: "{{ embedding_model_endpoint }}"
model_endpoint_name_for_query: "{{ model_endpoint_name_for_query }}"
name: "{{ name }}"
embedding_vector_columns:
- embedding_dimension: {{ embedding_dimension }}
name: "{{ name }}"
requested_schema_json: "{{ requested_schema_json }}"
schema_json: "{{ schema_json }}"
endpoint: "{{ endpoint }}"
index_subtype: "{{ index_subtype }}"
name: "{{ name }}"
status:
index_url: "{{ index_url }}"
indexed_row_count: {{ indexed_row_count }}
message: "{{ message }}"
ready: {{ ready }}
- name: index_id
value: "{{ index_id }}"
description: The 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.
description: The 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.
DELETE examples
- delete
Delete an AI Search index.
DELETE FROM databricks_workspace.aisearch.indexes
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;
Lifecycle Methods
- query
- remove_data
- scan
- sync
- upsert_data
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 }}"
}'
;
Remove rows by primary key from a Direct Access AI Search index.
EXEC databricks_workspace.aisearch.indexes.remove_data
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"primary_keys": "{{ primary_keys }}"
}'
;
Scan (paginate over) the rows of an AI Search index.
EXEC databricks_workspace.aisearch.indexes.scan
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"page_size": {{ page_size }},
"page_token": "{{ page_token }}"
}'
;
Synchronize a Delta Sync AI Search index with its source Delta table. Applies only to Delta Sync
EXEC databricks_workspace.aisearch.indexes.sync
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
;
Upsert rows into a Direct Access AI Search index.
EXEC databricks_workspace.aisearch.indexes.upsert_data
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"inputs_json": "{{ inputs_json }}"
}'
;