Function: computeNormalizedRelevance()
ts
function computeNormalizedRelevance(
directive,
queryText,
partition?
): number;Defined in: postgres/src/stores/internal/compute-normalized-relevance.ts:88
Computes normalized text relevance $R(L, Q) \in [0, 1]$ between a single lesson directive and queryText via MiniSearch.
Returns 1 when queryText is empty or matches directive under BM25 + prefix/fuzzy search, and 0 when no terms match.
Parameters
| Parameter | Type | Description |
|---|---|---|
directive | string | Lesson directive text $L$. |
queryText | string | Search query text $Q$. |
partition? | string | Optional partition identifier associated with the lesson. |
Returns
number
Normalized similarity score $R(L, Q) \in [0, 1]$.