Berserk Docs
Tabular OperatorsFilter Operators

vector-search

Semantic similarity search over a vector-indexed text field.

Ranks input rows against the query string using the segment's vector index and returns the top k rows with a _score column in [0, 1]. The field must be configured for vector indexing on the cluster (vsearch.fields); rows ingested before the field was configured score 0.

Syntax

vector-search '<query>' on=field [k=N] [min_score=S]

Return the top-k input rows by semantic similarity to <query>, with their similarity in _score. Rows sharing a log template share a score.

Parameters

NameDescription
queryQuery string literal. Encoded once per query by the coordinator.
onField to search over. A single column or dotted bag-path; multi-field forms are rejected.
kMaximum number of rows to return (default 100).
min_scoreMinimum score in [0, 1] for a row to be returned (default 0).

Examples

Example 1

datatable(body:string)[
  "database connection timeout",
  "authentication failure",
  "disk usage at 92%"
]
| vector-search 'database errors' on=body k=2
body (string)_score (real)
authentication failure0.0
database connection timeout0.0

Example 2

datatable(body:string)[
  "GET /api/users 200 ok",
  "POST /api/login 401 unauthorized",
  "GET /api/items 500 internal error"
]
| vector-search 'authentication failure' on=body min_score=0.3
body (string)_score (real)

On this page