Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
js search benchmark restricti
(version: 1)
Comparing performance of:
Lunr vs minisearch vs fuse.js
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://unpkg.com/lunr/lunr.js"></script> <script type="text/javascript" src="https://rawgit.com/bvaughn/js-search/1.2.0/dist/js-search.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/minisearch@2.2.2/dist/umd/index.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/fuse.js/dist/fuse.js"></script> <script> Benchmark.prototype.setup = function() { var books = []; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var json = JSON.parse(xmlhttp.responseText); books = json.books.map((b) => ({b.isbn, b.title, b.author})); } } xmlhttp.open('GET', 'http://bvaughn.github.io/js-search/books.json', true); xmlhttp.send(); }; </script>
Tests:
Lunr
var idx = lunr(function () { this.ref('isbn'); this.field('title'); this.field('author'); books.forEach(function (doc) { this.add(doc) }, this); })
minisearch
var miniSearch = new MiniSearch({ fields: ['isbn', 'title', 'author'], // fields to index for full-text search }); miniSearch.addAll(books)
fuse.js
const options = { includeScore: true, keys: ['isbn', 'title', 'author'] } const fuse = new Fuse(books, options)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Lunr
minisearch
fuse.js
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?