-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathworker.js
More file actions
20 lines (18 loc) · 1.01 KB
/
worker.js
File metadata and controls
20 lines (18 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
window = this;
importScripts('data/parsed.js?version=6', 'lujvo.js', 'lib/fullproof/unicode/categ_letters_numbers.js', 'lib/fullproof/unicode/normalizer_lowercase_nomark.js', 'lib/fullproof/unicode/unicode.js', 'lib/fullproof/analyzers.js', 'lib/fullproof/normalizers.js', 'lib/fullproof/misc/dataloader.js', 'lib/fullproof/capabilities.js', 'lib/fullproof/utils.js', 'lib/fullproof/common-engine.js', 'lib/fullproof/boolean-engine.js', 'lib/fullproof/resultsets.js', 'lib/fullproof/storemanager.js', 'lib/fullproof/stores/memory_store.js', 'search.js');
var searchId;
this.onmessage = function(ev) {
if (ev.data.kind == 'newSearch') {
searchId = ev.data.searchId;
search(ev.data.query, function(results) {
postMessage({kind: 'searchResults', results: results,
query:ev.data.query});
});
}
}
postMessage({kind: 'loading', message: 'Building index'});
setupSearchEngine(function() {
postMessage({kind: 'ready'});
}, function(percent) {
postMessage({kind: 'progress', percent: percent})
});