lunr.js¶
¶
var idx = lunr(function () {
// keys
this.field('title')
this.field('body')
this.metadataWhitelist = ['position'] // include matched location
this.add({
"title": "Alice",
"body": "Hello Alexandra",
"id": "1"
})
this.add({
"title": "Luna",
"body": "Hello Luna",
"id": "2"
})
})
will return