View source: R/vector-search.R
| db_vs_indexes_query | R Documentation |
Query a Vector Search Index
db_vs_indexes_query(
index,
columns,
filters_json,
query_vector = NULL,
query_text = NULL,
score_threshold = 0,
query_type = c("ANN", "HYBRID"),
num_results = 10,
host = db_host(),
token = db_token(),
perform_request = TRUE
)
index |
Name of vector search index |
columns |
Column names to include in response |
filters_json |
JSON string representing query filters, see details. |
query_vector |
Numeric vector. Required for direct vector access index and delta sync index using self managed vectors. |
query_text |
Required for delta sync index using model endpoint. |
score_threshold |
Numeric score threshold for the approximate nearest neighbour (ANN) search. Defaults to 0.0. |
query_type |
One of |
num_results |
Number of returns to return (default: 10). |
host |
Databricks workspace URL, defaults to calling |
token |
Databricks workspace token, defaults to calling |
perform_request |
If |
You cannot specify both query_vector and query_text at the same time.
filter_jsons examples:
'{"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
'{"id": 5, "age >=": 18}': Filter for id equal to 5 and age greater than
equal to 18
filter_jsons will convert attempt to use jsonlite::toJSON on any
non character vectors.
Refer to docs for Vector Search.
Other Vector Search API:
db_vs_endpoints_create(),
db_vs_endpoints_delete(),
db_vs_endpoints_get(),
db_vs_endpoints_list(),
db_vs_indexes_create(),
db_vs_indexes_delete(),
db_vs_indexes_delete_data(),
db_vs_indexes_get(),
db_vs_indexes_list(),
db_vs_indexes_query_next_page(),
db_vs_indexes_scan(),
db_vs_indexes_sync(),
db_vs_indexes_upsert_data(),
delta_sync_index_spec(),
direct_access_index_spec(),
embedding_source_column(),
embedding_vector_column()
## Not run:
db_vs_indexes_sync(
index = "myindex",
columns = c("id", "text"),
query_vector = c(1, 2, 3)
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.