1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-10-04 00:51:52 +02:00

v0.8 compatible export/import

This commit is contained in:
Thomas Wilkerling
2025-03-15 12:06:31 +01:00
parent a975b063c7
commit 76d089b27c
55 changed files with 1995 additions and 2032 deletions

View File

@@ -24,7 +24,7 @@ import "./document/search.js";
export default function Document(options) {
if (!this) {
if (this.constructor !== Document) {
return new Document(options);
}
@@ -40,9 +40,8 @@ export default function Document(options) {
keystore = options.keystore || 0;
keystore && (this.keystore = keystore);
this.fastupdate = !!options.fastupdate;
this.reg = this.fastupdate ? keystore && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */
/* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ ? new KeystoreMap(keystore) : new Map() : keystore && !0 ? new KeystoreSet(keystore) : new Set();
this.reg = this.fastupdate ? keystore && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */
/* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ ? new KeystoreMap(keystore) : new Map() : keystore && !0 ? new KeystoreSet(keystore) : new Set();
// todo support custom filter function
this.storetree = (tmp = document.store || null) && !0 !== tmp && [];
@@ -194,9 +193,11 @@ Document.prototype.commit = async function (replace, append) {
// queued:
// for(const index of this.index.values()){
// await index.db.commit(index, replace, append);
// }
// this.reg.clear();
};Document.prototype.destroy = function () {
};
Document.prototype.destroy = function () {
const promises = [];
for (const idx of this.index.values()) {
promises.push(idx.destroy());