@equationalapplications/core-llm-wiki 7.10.0 → 7.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3157,13 +3157,14 @@ var Fts5IndexStrategy = class {
3157
3157
  const cap = options.preFilterLimit ?? options.limit;
3158
3158
  const limit = cap >= Number.MAX_SAFE_INTEGER ? -1 : cap;
3159
3159
  const t = `${this.prefix}entries_fts`;
3160
- const bm25 = `bm25(${t}, 0.0, 0.0, 2.0, 1.0, 1.0)`;
3161
3160
  return this.db.getAllAsync(
3162
- `SELECT id, entity_id, max(0.0, -${bm25}) AS score
3163
- FROM ${t}
3164
- WHERE ${t} MATCH ? AND entity_id IN (SELECT value FROM json_each(?))
3165
- ORDER BY ${bm25}, id
3166
- LIMIT ?`,
3161
+ `SELECT id, entity_id, max(0.0, -raw) AS score FROM (
3162
+ SELECT id, entity_id, bm25(${t}, 0.0, 0.0, 2.0, 1.0, 1.0) AS raw
3163
+ FROM ${t}
3164
+ WHERE ${t} MATCH ? AND entity_id IN (SELECT value FROM json_each(?))
3165
+ ORDER BY raw, id
3166
+ LIMIT ?)
3167
+ ORDER BY raw, id`,
3167
3168
  [match, JSON.stringify(options.entityIds), limit]
3168
3169
  );
3169
3170
  }