Commit 557d33bf authored by Karel Bilek's avatar Karel Bilek Committed by lilia
Browse files

Fixing upper bounds on contact search (fixes #545)

parent a2290750
......@@ -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);
}
......
......@@ -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);
}
......@@ -408,7 +408,8 @@
index: {
name: 'search', // 'search' index on tokens array
lower: query,
upper: upper
upper: upper,
excludeUpper: true
}
}).always(resolve);
}.bind(this));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment