w.ai_search: AISearch¶
- class databricks.sdk.service.aisearch.AiSearchAPI¶
AI Search Endpoint: Represents the compute resources to host AI Search indexes. AIP-conformant replacement for the legacy VectorSearchEndpoints API; functionally equivalent.
- create_endpoint(parent: str, endpoint: Endpoint [, endpoint_id: Optional[str]]) Endpoint¶
Create a new AI Search endpoint.
- Parameters:
parent – str The Workspace where this Endpoint will be created. Format:
workspaces/{workspace_id}endpoint –
EndpointThe Endpoint resource to create. Fields other thanendpoint.namecarry the desired configuration;endpoint.nameis server-assigned fromparentandendpoint_id.endpoint_id – str (optional) The user-supplied short name for the Endpoint, per AIP-133. The server composes the full
Endpoint.nameas{parent}/endpoints/{endpoint_id}. AIP-133 does not listendpoint_idas a fields-may-be-required entry, so we annotate it OPTIONAL on the wire; the server still rejects empty values with INVALID_PARAMETER_VALUE.
- Returns:
- create_index(parent: str, index: Index [, index_id: Optional[str]]) Index¶
Create a new AI Search index.
- Parameters:
parent – str The Endpoint where this Index will be created. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}index –
IndexThe Index resource to create. Fields other thanindex.namecarry the desired configuration;index.nameis server-assigned fromparentandindex_id.index_id – str (optional) The user-supplied Unity Catalog table name for the Index, per AIP-133. The server composes the full
Index.nameas{parent}/indexes/{index_id}. AIP-133 does not listindex_idas a fields-may-be-required entry, so we annotate it OPTIONAL on the wire; the server still rejects empty values with INVALID_PARAMETER_VALUE.
- Returns:
- delete_endpoint(name: str)¶
Delete an AI Search endpoint.
- Parameters:
name – str Full resource name of the endpoint to delete. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}
- delete_index(name: str)¶
Delete an AI Search index.
- Parameters:
name – str Full resource name of the index to delete. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}
- get_endpoint(name: str) Endpoint¶
Get details for a single AI Search endpoint.
- Parameters:
name – str Full resource name of the endpoint. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}- Returns:
- get_index(name: str) Index¶
Get details for a single AI Search index.
- Parameters:
name – str Full resource name of the index. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}- Returns:
- list_endpoints(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Endpoint]¶
List AI Search endpoints in a workspace.
- Parameters:
parent – str The Workspace that owns this collection of endpoints. Format:
workspaces/{workspace_id}page_size – int (optional) Best-effort upper bound on the number of results to return. Honored as an upper bound by the shim:
page_sizeonly narrows the legacy backend’s response, never widens it, so the practical cap ismin(page_size, legacy_fixed_page_size).page_token – str (optional) Page token from a previous response. If not provided, returns the first page.
- Returns:
Iterator over
Endpoint
- list_indexes(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Index]¶
List AI Search indexes on an endpoint.
- Parameters:
parent – str The Endpoint that owns this collection of indexes. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}page_size – int (optional) Best-effort upper bound on the number of results to return. Honored as an upper bound by the shim:
page_sizeonly narrows the legacy backend’s response, never widens it, so the practical cap ismin(page_size, legacy_fixed_page_size).page_token – str (optional) Page token from a previous response. If not provided, returns the first page.
- Returns:
Iterator over
Index
- query_index(name: str, columns: List[str] [, columns_to_rerank: Optional[List[str]], facets: Optional[List[str]], filters_json: Optional[str], max_results: Optional[int], query_columns: Optional[List[str]], query_text: Optional[str], query_type: Optional[str], query_vector: Optional[List[float]], reranker: Optional[RerankerConfig], score_threshold: Optional[float], sort_columns: Optional[List[str]]]) QueryIndexResponse¶
Query (search) an AI Search index. Read-only, so a read-scoped token may invoke it.
- Parameters:
name – str Full resource name of the index to query. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}columns – List[str] Column names to include in each result row.
columns_to_rerank – List[str] (optional) Columns whose values are sent to the reranker.
facets – List[str] (optional) Facets to compute over the matched results (e.g.
"category TOP 5").filters_json – str (optional) JSON string describing query filters (e.g.
{"id >": 5}).max_results – int (optional) Maximum number of results to return (the legacy
num_results). Defaults to 10.query_columns – List[str] (optional) Text columns to search for
query_text. When empty, all text columns are searched.query_text – str (optional) Query text. Required for Delta Sync indexes that compute embeddings from a model endpoint.
query_type – str (optional) Query type:
ANN,HYBRID, orFULL_TEXT. Defaults toANN.query_vector – List[float] (optional) Query vector. Required for Direct Access indexes and Delta Sync indexes with self-managed vectors.
reranker –
RerankerConfig(optional) If set, results are reranked before being returned.score_threshold – float (optional) Score threshold for the approximate nearest-neighbor search. Defaults to 0.0.
sort_columns – List[str] (optional) Sort clauses, e.g.
["rating DESC", "price ASC"]. Overrides relevance ordering.
- Returns:
- remove_data(name: str, primary_keys: List[str]) RemoveDataResponse¶
Remove rows by primary key from a Direct Access AI Search index.
- Parameters:
name – str Full resource name of the index. Must be a Direct Access index. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}primary_keys – List[str] Primary keys of the rows to remove.
- Returns:
- scan_index(name: str [, page_size: Optional[int], page_token: Optional[str]]) ScanIndexResponse¶
Scan (paginate over) the rows of an AI Search index.
- Parameters:
name – str Full resource name of the index to scan. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}page_size – int (optional) Maximum number of rows to return in this page.
page_token – str (optional) Page token from a previous response; if unset, scanning starts from the beginning.
- Returns:
- sync_index(name: str) SyncIndexResponse¶
Synchronize a Delta Sync AI Search index with its source Delta table. Applies only to Delta Sync indexes; Direct Access indexes are written via the data-plane upsert path.
- Parameters:
name – str Full resource name of the index to synchronize. Must be a Delta Sync index. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}- Returns:
- update_endpoint(name: str, endpoint: Endpoint, update_mask: FieldMask) Endpoint¶
Update an existing AI Search endpoint. Multi-bucket masks are supported and dispatched in deterministic bucket order: budget policy, custom tags, throughput, then scaling/replicas. Per-bucket dispatch is not atomic across buckets — if a later bucket fails, earlier buckets may already have been applied.
- Parameters:
name – str Name of the AI Search endpoint. Server-assigned full resource path (
workspaces/{workspace}/endpoints/{endpoint}) on output. On create, the user-supplied short name is conveyed viaCreateEndpointRequest.endpoint_id; the server composes the fullnameand returns it on the response.endpoint –
EndpointThe Endpoint resource to update.endpoint.namecarries the full resource path.update_mask – FieldMask The list of fields to update.
- Returns:
- upsert_data(name: str, inputs_json: str) UpsertDataResponse¶
Upsert rows into a Direct Access AI Search index.
- Parameters:
name – str Full resource name of the index. Must be a Direct Access index. Format:
workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}inputs_json – str JSON document describing the rows to upsert.
- Returns: