Lunr.js 2.1.5 已发布,Lunr.js 是一个设计小巧但功能全面的 JavaScript 搜索引擎,类似 Solr。 该版本了修复导致结果元数据嵌套在搜索词下而不是字段名的 bug #320。详情 使用示例: 先创建一个非常简单的搜索索引 var idx = lunr(function () { this.field('title') this.field('body') this.add({ "title": "Twelfth-Night", "body": "If music be the food of love, play on: Give me excess of it…", "author": "William Shakespeare", "id": "1" }) }) 然后 idx.search("love") 结果返回 [ { "ref": "1", "score": 0.3535533905932737, "matchData": { "metadata": { "love": { "body": {} } } } } ] Lunr.js 2.1.5 发布,小巧精确的 JavaScript 搜索引擎下载地址