1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-09-24 20:41:28 +02:00

fix default resolver state, fix indexeddb transaction recycling

This commit is contained in:
Thomas Wilkerling
2025-03-21 13:03:02 +01:00
parent 2c8aee791c
commit adde2a9861
27 changed files with 606 additions and 593 deletions

View File

@@ -285,19 +285,20 @@ IdxDB.prototype.transaction = function (ref, modifier, task) {
return new Promise((resolve, reject) => {
transaction.onerror = err => {
this.trx[ref + ":" + modifier] = null;
transaction.abort();
transaction = store = null;
reject(err);
//db.close;
};
transaction.oncomplete = res => {
this.trx[ref + ":" + modifier] = null;
transaction = store = null;
resolve(res || !0);
//db.close;
};
return task.call(this, store);
const promise = task.call(this, store);
//
this.trx[ref + ":" + modifier] = null;
return promise;
});
};

View File

@@ -61,7 +61,7 @@ Document.prototype.search = function (query, limit, options, _promises) {
tag,
offset,
count = 0,
resolve,
resolve = /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/,
highlight;
@@ -412,7 +412,7 @@ Document.prototype.search = function (query, limit, options, _promises) {
};
}
if (enrich && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ && this.db && promises.length) {
if (enrich && !0 && this.db && promises.length) {
const self = this;
return Promise.all(promises).then(function (promises) {
for (let j = 0; j < promises.length; j++) {

View File

@@ -57,7 +57,8 @@ Index.prototype.search = function (query, limit, options) {
offset = options.offset || 0;
context = options.context;
suggest = options.suggest;
resolve = /*global_resolve &&*/ /* suggest */ /* append: */ /* enrich */!1 !== options.resolve;
resolve = /*global_resolve &&*/ /* suggest */ /* append: */ /* enrich */
!1 !== options.resolve;
//resolve || (global_resolve = 0);
enrich = resolve && options.enrich;
boost = options.boost;