Add search field to inbox
Using the search field produces a filtered view of all contacts and groups containing the input. To make this fast and scalable, add an index on a 'tokens' array containing words from the conversation name and different forms of phone number. Closes #365 // FREEBIE
This commit is contained in:
parent
7414828bb3
commit
f70c22f898
8 changed files with 221 additions and 9 deletions
|
@ -34,6 +34,21 @@
|
|||
var items = transaction.db.createObjectStore("items");
|
||||
next();
|
||||
}
|
||||
},
|
||||
{
|
||||
version: "2.0",
|
||||
migrate: function(transaction, next) {
|
||||
var conversations = transaction.objectStore("conversations");
|
||||
conversations.createIndex("search", "tokens", { unique: false, multiEntry: true });
|
||||
|
||||
var all = new Whisper.ConversationCollection();
|
||||
all.fetch().then(function() {
|
||||
all.each(function(model) {
|
||||
model.updateTokens();
|
||||
model.save();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue