Annotation Interface VectorSearch
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionintBeam size hint for vector search accuracy (maps toSET LOCAL vector_search_beam_size).String[]Columns to SELECT alongside the distance.intMaximum number of results to return.Distance metric for similarity comparison.String[]Prefix columns for the vector index (CockroachDB v26.2+).Name of the method parameter that holds the query vector (float[]).booleanRun inside a read-only transaction for consistency.Column name storing the vector embeddings.
-
Element Details
-
table
String tableTable containing the vector column. -
vectorColumn
String vectorColumnColumn name storing the vector embeddings.- Default:
"embedding"
-
metric
DistanceMetric metricDistance metric for similarity comparison.- Default:
COSINE
-
limit
int limitMaximum number of results to return.- Default:
10
-
queryParam
String queryParamName of the method parameter that holds the query vector (float[]).- Default:
"queryVector"
-
columns
String[] columnsColumns to SELECT alongside the distance. Empty = all columns.- Default:
{}
-
readOnly
boolean readOnlyRun inside a read-only transaction for consistency.- Default:
true
-
beamSize
int beamSizeBeam size hint for vector search accuracy (maps toSET LOCAL vector_search_beam_size). 0 = use database default.- Default:
0
-
prefixColumns
String[] prefixColumnsPrefix columns for the vector index (CockroachDB v26.2+).Prefix columns enable pre-filtering in the vector index itself, avoiding a full scan. They must appear before the vector column in the
CREATE VECTOR INDEXstatement.Example:
prefixColumns = {"tenant_id"}generates:CREATE VECTOR INDEX ON table (tenant_id, embedding vector_cosine_ops)
- Default:
{}
-