1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-09-27 22:08:58 +02:00

export/import document worker

This commit is contained in:
Thomas Wilkerling
2025-03-20 21:57:25 +01:00
parent e55c2d1efc
commit f2302f0dee
64 changed files with 2483 additions and 1243 deletions

View File

@@ -60,6 +60,7 @@ const fs = require("fs").promises;
// -----------------------
await fs.mkdir("./export/").catch(e => {});
// call export
await document.export(async function(key, data){
await fs.writeFile("./export/" + key, data, "utf8");
});
@@ -75,7 +76,8 @@ const fs = require("fs").promises;
const files = await fs.readdir("./export/");
await Promise.all(files.map(async file => {
const data = await fs.readFile("./export/" + file, "utf8");
await document.import(file, data);
// call import
document.import(file, data);
}))
// perform query