Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.
Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.
The vector-search-indexes
command group within the Databricks CLI contains commands to manage vector search indexes. A vector search index is an efficient representation of your embedding vectors that supports real-time and approximate nearest neighbor (ANN) search queries. See How to create and query a vector search index.
databricks vector-search-indexes create-index
Create a new index.
databricks vector-search-indexes create-index NAME ENDPOINT_NAME PRIMARY_KEY INDEX_TYPE [flags]
Arguments
NAME
Name of the index
ENDPOINT_NAME
Name of the endpoint to be used for serving the index
PRIMARY_KEY
Primary key of the index
INDEX_TYPE
There are two types of Vector Search indexes, Delta sync (an index that automatically syncs with a source Delta Table) or direct access (an index that supports direct read and write of vectors and metadata). Supported values: DELTA_SYNC
, DIRECT_ACCESS
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
Examples
The following example creates a new Delta Sync index:
databricks vector-search-indexes create-index my-index my-endpoint id DELTA_SYNC
The following example creates a new Direct Access index:
databricks vector-search-indexes create-index my-index my-endpoint id DIRECT_ACCESS
databricks vector-search-indexes delete-data-vector-index
Delete data from index.
databricks vector-search-indexes delete-data-vector-index INDEX_NAME [flags]
Arguments
INDEX_NAME
Name of the vector index where data is to be deleted. Must be a Direct Vector Access Index.
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
Examples
The following example deletes data from a Direct Vector Access index:
databricks vector-search-indexes delete-data-vector-index my-index --json '{"primary_keys": ["key1", "key2"]}'
databricks vector-search-indexes delete-index
Delete an index.
databricks vector-search-indexes delete-index INDEX_NAME [flags]
Arguments
INDEX_NAME
Name of the index
Options
Examples
The following example deletes a vector search index:
databricks vector-search-indexes delete-index my-index
databricks vector-search-indexes get-index
Get an index.
databricks vector-search-indexes get-index INDEX_NAME [flags]
Arguments
INDEX_NAME
Name of the index
Options
Examples
The following example gets details for a vector search index:
databricks vector-search-indexes get-index my-index
databricks vector-search-indexes list-indexes
List indexes.
databricks vector-search-indexes list-indexes ENDPOINT_NAME [flags]
Arguments
ENDPOINT_NAME
Name of the endpoint
Options
--page-token string
Token for pagination
Examples
The following example lists all indexes in an endpoint:
databricks vector-search-indexes list-indexes my-endpoint
The following example lists indexes using pagination:
databricks vector-search-indexes list-indexes my-endpoint --page-token next-page-token
databricks vector-search-indexes query-index
Query an index.
databricks vector-search-indexes query-index INDEX_NAME [flags]
Arguments
INDEX_NAME
Name of the vector index to query
Options
--filters-json string
JSON string representing query filters
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
--num-results int
Number of results to return
--query-text string
Query text
--query-type string
The query type to use
--score-threshold float
Threshold for the approximate nearest neighbor search
Examples
The following example queries an index with text:
databricks vector-search-indexes query-index my-index --query-text "search term" --num-results 10
The following example queries an index with filters:
databricks vector-search-indexes query-index my-index --query-text "search term" --filters-json '{"category": "product"}' --num-results 5
databricks vector-search-indexes query-next-page
Query next page.
databricks vector-search-indexes query-next-page INDEX_NAME [flags]
Arguments
INDEX_NAME
Name of the vector index to query
Options
--endpoint-name string
Name of the endpoint
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
--page-token string
Page token returned from previous QueryVectorIndex or QueryVectorIndexNextPage API
Examples
The following example queries the next page of results:
databricks vector-search-indexes query-next-page my-index --endpoint-name my-endpoint --page-token "next-page-token"
databricks vector-search-indexes scan-index
Scan an index.
databricks vector-search-indexes scan-index INDEX_NAME [flags]
Arguments
INDEX_NAME
Name of the vector index to scan
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
--last-primary-key string
Primary key of the last entry returned in the previous scan
--num-results int
Number of results to return
Examples
The following example scans an index:
databricks vector-search-indexes scan-index my-index --num-results 100
The following example scans an index starting from a specific key:
databricks vector-search-indexes scan-index my-index --last-primary-key "key123" --num-results 100
databricks vector-search-indexes sync-index
Synchronize an index.
databricks vector-search-indexes sync-index INDEX_NAME [flags]
Arguments
INDEX_NAME
Name of the vector index to synchronize. Must be a Delta Sync Index.
Options
Examples
The following example triggers synchronization for a Delta Sync index:
databricks vector-search-indexes sync-index my-delta-sync-index
databricks vector-search-indexes upsert-data-vector-index
Upsert data into an index.
databricks vector-search-indexes upsert-data-vector-index INDEX_NAME INPUTS_JSON [flags]
Arguments
INDEX_NAME
Name of the vector index where data is to be upserted. Must be a Direct Vector Access Index.
INPUTS_JSON
JSON string representing the data to be upserted
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
Examples
The following example upserts data into a Direct Vector Access index:
databricks vector-search-indexes upsert-data-vector-index my-index '{"vectors": [{"id": "1", "vector": [0.1, 0.2, 0.3], "metadata": {"title": "Document 1"}}]}'
Global flags
--debug
Whether to enable debug logging.
-h
or --help
Display help for the Databricks CLI or the related command group or the related command.
--log-file
string
A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.
--log-format
format
The log format type, text
or json
. The default value is text
.
--log-level
string
A string representing the log format level. If not specified then the log format level is disabled.
-o, --output
type
The command output type, text
or json
. The default value is text
.
-p, --profile
string
The name of the profile in the ~/.databrickscfg
file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT
is used.
--progress-format
format
The format to display progress logs: default
, append
, inplace
, or json
-t, --target
string
If applicable, the bundle target to use