generated from ztimson/template
Better search results
This commit is contained in:
+3
-3
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user