Actions51
- Genie Actions
- Databricks SQL Actions
- Unity Catalog Actions
- Model Serving Actions
- Files Actions
- Vector Search Actions
- Jobs Actions
- Clusters Actions
Vector Search → Query Index
AI-generatedSummary
Query a vector search index using either raw text (converted automatically to embeddings) or pre-computed vector embeddings, with options to customize the search mode, result columns, number of results, filtering, and optional reranking for improved relevance.
Inputs
- Index Name (required) — Specify the name of the vector search index to query.
- Query Type (required) — Choose whether to query using text (automatically converted to vector embeddings) or provide pre-computed vector embeddings directly.
- Query Text (required) — Provide the text string to search for; only required if Query Type is 'Text Query'.
- Query Vector (required) — Provide an array of numbers representing vector embeddings; only required if Query Type is 'Vector Query'.
- Search Mode — Select the search algorithm mode: 'HYBRID' combines semantic vector search and keyword search, while 'ANN' is pure approximate nearest neighbor vector similarity search.
- Columns to Return (required) — Enter a comma-separated list of column names to include in the query results.
- Number of Results — Define the maximum number of search results to return; defaults to 10.
- Enable Reranking — Enable reranking of the search results using a specified reranker model to enhance relevance.
- Reranker Model (required) — Specify the name of the reranker model to use if reranking is enabled; default is 'databricks_reranker'.
- Columns to Rerank (required) — Comma-separated list of columns used by the reranker model to improve ranking; required if reranking is enabled.
- Options: Filter Expression — Optional SQL-like filter expression to restrict results based on criteria (e.g., "category = 'docs' AND published = true").
- Options: Score Threshold — Optional minimum relevance score threshold (between 0 and 1) to filter out lower scoring results.
Output shape
a list of JSON objects representing the matched vectors and their associated data columns as specified.
The operation returns the search results of the vector index query, with each item containing the requested columns. Results may be filtered by score threshold and filter expressions. Reranking is optional and controlled by the input parameters.
Examples
Example 1: Querying vector search index with text input
Index Name = 'my-index', Query Type = 'text', Query Text = 'machine learning', Search Mode = 'HYBRID', Columns to Return = 'content,url,title', Number of Results = 5, Enable Reranking = false
Example 2: Querying vector search index with vector embeddings and reranking
Index Name = 'my-index', Query Type = 'vector', Query Vector = [0.1, 0.2, 0.3], Search Mode = 'ANN', Columns to Return = 'content,title', Number of Results = 15, Enable Reranking = true, Reranker Model = 'databricks_reranker', Columns to Rerank = 'content,title'