mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-09-24 20:41:28 +02:00
43 lines
947 B
HTML
43 lines
947 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Benchmark: minisearch-7.1.2</title>
|
|
</head>
|
|
<body>
|
|
<h2>Benchmark: minisearch-7.1.2</h2><hr/>
|
|
<h4>Indexed Text: "Gulliver's Travels" (Swift Jonathan 1726)</h4>
|
|
<div id="result" style="white-space: pre; font-family: Monospaced, monospace"></div>
|
|
<script src="https://cdn.jsdelivr.net/npm/minisearch@7.1.2/dist/umd/index.min.js"></script>
|
|
<script type="module">
|
|
|
|
import { suite } from "../../bench.js";
|
|
|
|
let lib;
|
|
|
|
suite["minisearch"] = {
|
|
|
|
init: function(){
|
|
|
|
lib = new MiniSearch({
|
|
fields: ["text"],
|
|
storeFields: ["id"]
|
|
});
|
|
},
|
|
add: function(data){
|
|
|
|
for(let i = 0; i < data.length; i++){
|
|
|
|
lib.add({ id: i, text: data[i] });
|
|
}
|
|
},
|
|
query: function(query){
|
|
|
|
return lib.search(query);
|
|
}
|
|
};
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|