Method BuildKnnSql
- Namespace
- Qavren.Edge.VectorData
- Assembly
- Qavren.Edge.VectorData.dll
BuildKnnSql(bool, bool, bool)
The vec0 KNN query. The filter, when present, is pushed in as
v.rowid IN (SELECT "_rowid" FROM <data table> WHERE ...): vec0's BestIndex
claims a rowid IN (...) constraint with omit = 1 and ANDs the bitmap into the
chunk validity bitmap before any distance is computed, so this is a true pre-filter and
never degrades to a client-side pass.
public string BuildKnnSql(bool hasFilter, bool hasScoreThreshold, bool includeVectors)
Parameters
hasFilterboolEmit the rowid pre-filter bracket, with FilterPlaceholder inside it.
hasScoreThresholdboolEmit the
$scoreThresholdbracket.includeVectorsboolProject the stored vector.
Returns
- string
The query.