Better search results
Publish Library / Build NPM Project (push) Successful in 4m47s
Publish Library / Tag Version (push) Successful in 9s

This commit is contained in:
2026-09-20 19:05:25 -04:00
parent 15f15e06f1
commit 8d4258b951
6 changed files with 467 additions and 99 deletions
+3 -3
View File
@@ -107,7 +107,7 @@ export class ZimManager {
const file = match.href + (match.href.endsWith('.zim') ? '' : '.zim');
await fs.promises.rm(path.join(this.#dir, file), {force: true});
await this.#ensureServer();
await this.#waitUntilVisible(file, {expect: false});
await this.#waitUntilVicsible(file, {expect: false});
return {file: match.file, status: 'deleted'};
}
@@ -154,9 +154,9 @@ export class ZimManager {
}
/** Two-pass fulltext search across every local ZIM, returns enriched results matching catalog/list shape. */
async search(terms, limit = 20) {
async search(terms, {limit = 20, sources = null} = {}) {
const server = await this.#ensureServer();
return server.search(terms, limit);
return server.search(terms, {limit, sources});
}
/** Checks all local ZIMs against the catalog and updates any that are outdated. */