lunr(function() { this.field('keywords' , { boost: 30 }); this.field('title', { boost: 10 }); this.field('description' , { boost: 5 }); this.field('body'); this.ref('id'); this.metadataWhitelist = ['position']; documents.forEach(function(doc) { this.add(doc, { boost: doc.boost }); }, this) })
Lunr(function() { this.ref('id'); this.field('heavy', { boost: 10 }); this.field('light'); })
function resetIndex() { index = lunr(function () { this.field('file'); this.field('type'); this.ref('path'); }); }