Skip to main content

Ai Search

View as Markdown

Query an AI Search index Public Preview

POST /api/2.0/ai-search/{name=workspaces/*/endpoints/*/indexes/*}:query

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

API scopes: ai-search

Parameters

namestringRequiredpath

Full resource name of the index to query. Format: workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}

Request body

columnsarray of stringRequired

Column names to include in each result row.

query_vectorarray of float

Query vector. Required for Direct Access indexes and Delta Sync indexes with self-managed vectors.

query_textstring

Query text. Required for Delta Sync indexes that compute embeddings from a model endpoint.

filters_jsonstring

JSON string describing query filters (e.g. {"id >": 5}).

score_thresholdfloat

Score threshold for the approximate nearest-neighbor search. Defaults to 0.0.

query_typestring

Query type: ANN, HYBRID, or FULL_TEXT. Defaults to ANN.

columns_to_rerankarray of string

Columns whose values are sent to the reranker.

rerankerobject

If set, results are reranked before being returned.

Show child attributesHide child attributes
modelstring

Reranker identifier: "databricks_reranker" for the base model, or a Model Serving endpoint name when model_type is MODEL_TYPE_FINETUNED.

parametersobject

Parameters controlling reranking.

Show child attributesHide child attributes
columns_to_rerankarray of string

Columns whose values are concatenated and sent to the reranker.

model_typestring

Discriminator for how model is interpreted.

Values:

  • MODEL_TYPE_UNSPECIFIED
  • MODEL_TYPE_BASE
  • MODEL_TYPE_FINETUNED
query_columnsarray of string

Text columns to search for query_text. When empty, all text columns are searched.

sort_columnsarray of string

Sort clauses, e.g. ["rating DESC", "price ASC"]. Overrides relevance ordering.

facetsarray of string

Facets to compute over the matched results (e.g. "category TOP 5").

max_resultsint32

Maximum number of results to return (the legacy num_results). Defaults to 10.

Response

manifestobjectOutput only

Metadata describing the result columns.

Show child attributesHide child attributes
column_countint32Output only

Number of columns in the result set.

columnsarray of objectOutput only

Information about each column in the result set.

Show child attributesHide child attributes
namestringOutput only

Name of the column.

type_textstringOutput only

Data type of the column (e.g., "string", "int", "array<float>").

facet_column_countint32Output only

Number of columns in the facet result.

facet_columnsarray of objectOutput only

Information about each facet column.

Show child attributesHide child attributes
namestringOutput only

Name of the column.

type_textstringOutput only

Data type of the column (e.g., "string", "int", "array<float>").

resultobjectOutput only

The matched result rows.

Show child attributesHide child attributes
row_countint32Output only

Number of rows in the result set.

data_arrayarray of array of objectOutput only

Result rows; each row is a list of column values aligned with the manifest columns.

facet_resultobjectOutput only

Facet aggregation rows, when facets were requested.

Show child attributesHide child attributes
facet_row_countint32Output only

Number of facet rows returned.

facet_arrayarray of array of objectOutput only

Facet rows; each row is [facet_column_name, value_or_range, count].

Remove data from an AI Search index Public Preview

POST /api/2.0/ai-search/{name=workspaces/*/endpoints/*/indexes/*}:removeData

Remove rows by primary key from a Direct Access AI Search index.

API scopes: ai-search

Parameters

namestringRequiredpath

Full resource name of the index. Must be a Direct Access index. Format: workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}

Request body

primary_keysarray of stringRequired

Primary keys of the rows to remove.

Response

statusstringOutput only

Overall status of the delete.

Values:

  • SUCCESS
  • PARTIAL_SUCCESS
  • FAILURE
resultobjectOutput only

Per-row outcome of the delete.

Show child attributesHide child attributes
success_row_countint64Output only

Count of rows processed successfully.

failed_primary_keysarray of stringOutput only

Primary keys of rows that failed to process.

Scan an AI Search index Public Preview

POST /api/2.0/ai-search/{name=workspaces/*/endpoints/*/indexes/*}:scan

Scan (paginate over) the rows of an AI Search index.

API scopes: ai-search

Parameters

namestringRequiredpath

Full resource name of the index to scan. Format: workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}

Request body

page_sizeint32

Maximum number of rows to return in this page.

page_tokenstring

Page token from a previous response; if unset, scanning starts from the beginning.

Response

dataarray of objectOutput only

The rows in this page, each a struct of column name to value.

next_page_tokenstringOutput only

Token for the next page; empty when the scan is exhausted.

Synchronize an AI Search index Public Preview

POST /api/2.0/ai-search/{name=workspaces/*/endpoints/*/indexes/*}:sync

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.

API scopes: ai-search

Parameters

namestringRequiredpath

Full resource name of the index to synchronize. Must be a Delta Sync index. Format: workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}

Upsert data into an AI Search index Public Preview

POST /api/2.0/ai-search/{name=workspaces/*/endpoints/*/indexes/*}:upsertData

Upsert rows into a Direct Access AI Search index.

API scopes: ai-search

Parameters

namestringRequiredpath

Full resource name of the index. Must be a Direct Access index. Format: workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}

Request body

inputs_jsonstringRequired

JSON document describing the rows to upsert.

Response

statusstringOutput only

Overall status of the upsert.

Values:

  • SUCCESS
  • PARTIAL_SUCCESS
  • FAILURE
resultobjectOutput only

Per-row outcome of the upsert.

Show child attributesHide child attributes
success_row_countint64Output only

Count of rows processed successfully.

failed_primary_keysarray of stringOutput only

Primary keys of rows that failed to process.