w.vector_search_indexes: Indexes

class databricks.sdk.service.vectorsearch.VectorSearchIndexesAPI

Index: An efficient representation of your embedding vectors that supports real-time and efficient approximate nearest neighbor (ANN) search queries.

There are 2 types of Vector Search indexes: * Delta Sync Index: An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes. * Direct Vector Access Index: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates.

create_index(name: str, endpoint_name: str, primary_key: str, index_type: VectorIndexType [, delta_sync_index_spec: Optional[DeltaSyncVectorIndexSpecRequest], direct_access_index_spec: Optional[DirectAccessVectorIndexSpec]]) CreateVectorIndexResponse

Create an index.

Create a new index.

Parameters:
  • name – str Name of the index

  • endpoint_name – str Name of the endpoint to be used for serving the index

  • primary_key – str Primary key of the index

  • index_type

    VectorIndexType There are 2 types of Vector Search indexes:

    • DELTA_SYNC: An index that automatically syncs with a source Delta Table, automatically and

    incrementally updating the index as the underlying data in the Delta Table changes. - DIRECT_ACCESS: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates.

  • delta_sync_index_specDeltaSyncVectorIndexSpecRequest (optional) Specification for Delta Sync Index. Required if index_type is DELTA_SYNC.

  • direct_access_index_specDirectAccessVectorIndexSpec (optional) Specification for Direct Vector Access Index. Required if index_type is DIRECT_ACCESS.

Returns:

CreateVectorIndexResponse

delete_data_vector_index(index_name: str, primary_keys: List[str]) DeleteDataVectorIndexResponse

Delete data from index.

Handles the deletion of data from a specified vector index.

Parameters:
  • index_name – str Name of the vector index where data is to be deleted. Must be a Direct Vector Access Index.

  • primary_keys – List[str] List of primary keys for the data to be deleted.

Returns:

DeleteDataVectorIndexResponse

delete_index(index_name: str)

Delete an index.

Delete an index.

Parameters:

index_name – str Name of the index

get_index(index_name: str) VectorIndex

Get an index.

Get an index.

Parameters:

index_name – str Name of the index

Returns:

VectorIndex

list_indexes(endpoint_name: str [, page_token: Optional[str]]) Iterator[MiniVectorIndex]

List indexes.

List all indexes in the given endpoint.

Parameters:
  • endpoint_name – str Name of the endpoint

  • page_token – str (optional) Token for pagination

Returns:

Iterator over MiniVectorIndex

query_index(index_name: str, columns: List[str] [, filters_json: Optional[str], num_results: Optional[int], query_text: Optional[str], query_vector: Optional[List[float]], score_threshold: Optional[float]]) QueryVectorIndexResponse

Query an index.

Query the specified vector index.

Parameters:
  • index_name – str Name of the vector index to query.

  • columns – List[str] List of column names to include in the response.

  • filters_json

    str (optional) JSON string representing query filters.

    Example filters: - {“id <”: 5}: Filter for id less than 5. - {“id >”: 5}: Filter for id greater than 5. - {“id <=”: 5}: Filter for id less than equal to 5. - {“id >=”: 5}: Filter for id greater than equal to 5. - {“id”: 5}: Filter for id equal to 5.

  • num_results – int (optional) Number of results to return. Defaults to 10.

  • query_text – str (optional) Query text. Required for Delta Sync Index using model endpoint.

  • query_vector – List[float] (optional) Query vector. Required for Direct Vector Access Index and Delta Sync Index using self-managed vectors.

  • score_threshold – float (optional) Threshold for the approximate nearest neighbor search. Defaults to 0.0.

Returns:

QueryVectorIndexResponse

sync_index(index_name: str)

Synchronize an index.

Triggers a synchronization process for a specified vector index.

Parameters:

index_name – str Name of the vector index to synchronize. Must be a Delta Sync Index.

upsert_data_vector_index(index_name: str, inputs_json: str) UpsertDataVectorIndexResponse

Upsert data into an index.

Handles the upserting of data into a specified vector index.

Parameters:
  • index_name – str Name of the vector index where data is to be upserted. Must be a Direct Vector Access Index.

  • inputs_json – str JSON string representing the data to be upserted.

Returns:

UpsertDataVectorIndexResponse