Fixing upper bounds on contact search (fixes #545)

This commit is contained in:
Karel Bilek 2015-12-31 23:05:41 +01:00 committed by lilia
parent a229075016
commit 557d33bf88
3 changed files with 12 additions and 7 deletions

View file

@ -421,13 +421,15 @@
});
} else if (options.index) {
index = store.index(options.index.name);
var excludeLower = !!options.index.excludeLower;
var excludeUpper = !!options.index.excludeUpper;
if (index) {
if (options.index.lower && options.index.upper) {
bounds = IDBKeyRange.bound(options.index.lower, options.index.upper);
bounds = IDBKeyRange.bound(options.index.lower, options.index.upper, excludeLower, excludeUpper);
} else if (options.index.lower) {
bounds = IDBKeyRange.lowerBound(options.index.lower);
bounds = IDBKeyRange.lowerBound(options.index.lower, excludeLower);
} else if (options.index.upper) {
bounds = IDBKeyRange.upperBound(options.index.upper);
bounds = IDBKeyRange.upperBound(options.index.upper, excludeUpper);
} else if (options.index.only) {
bounds = IDBKeyRange.only(options.index.only);
}

View file

@ -21779,13 +21779,15 @@ return jQuery;
});
} else if (options.index) {
index = store.index(options.index.name);
var excludeLower = !!options.index.excludeLower;
var excludeUpper = !!options.index.excludeUpper;
if (index) {
if (options.index.lower && options.index.upper) {
bounds = IDBKeyRange.bound(options.index.lower, options.index.upper);
bounds = IDBKeyRange.bound(options.index.lower, options.index.upper, excludeLower, excludeUpper);
} else if (options.index.lower) {
bounds = IDBKeyRange.lowerBound(options.index.lower);
bounds = IDBKeyRange.lowerBound(options.index.lower, excludeLower);
} else if (options.index.upper) {
bounds = IDBKeyRange.upperBound(options.index.upper);
bounds = IDBKeyRange.upperBound(options.index.upper, excludeUpper);
} else if (options.index.only) {
bounds = IDBKeyRange.only(options.index.only);
}

View file

@ -408,7 +408,8 @@
index: {
name: 'search', // 'search' index on tokens array
lower: query,
upper: upper
upper: upper,
excludeUpper: true
}
}).always(resolve);
}.bind(this));