Annotation Interface SemanticSearch
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionintBeam size hint for vector search accuracy.String[]Columns to SELECT alongside the distance.SQL WHERE clause for structured filtering (appended after vector search).intMaximum number of results to return.doubleMaximum distance threshold — results farther than this are excluded.Distance metric for similarity comparison.String[]Prefix columns for the vector index (CockroachDB v26.2+).Name of the method parameter holding the query vector (float[]).booleanRun inside a read-only transaction for consistency.Column name storing the vector embeddings.
-
Element Details
-
table
String tableTable containing both vector and relational data. -
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 holding the query vector (float[]).- Default:
"queryVector"
-
filter
String filterSQL WHERE clause for structured filtering (appended after vector search). Supports Spring Expression Language (SpEL) with method parameter references. Example:"category = :category AND active = true"- Default:
""
-
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. 0 = database default.- Default:
0
-
maxDistance
double maxDistanceMaximum distance threshold — results farther than this are excluded. A value<= 0disables the threshold.- Default:
0.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:
{}
-