mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-09-08 21:20:41 +02:00
add v0.8
This commit is contained in:
37
test/flexsearch-0.8.0-match/index.html
Normal file
37
test/flexsearch-0.8.0-match/index.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Benchmark</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Benchmark: flexsearch-0.8.0-match</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://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.compact.min.js"></script>
|
||||
<script type="module">
|
||||
|
||||
import { suite } from "../../bench.js";
|
||||
let lib;
|
||||
|
||||
suite["flexsearch-0.8.0-match"] = {
|
||||
|
||||
init: function(){
|
||||
lib = new FlexSearch.Index({
|
||||
tokenize: "reverse",
|
||||
encoder: FlexSearch.Charset.LatinAdvanced
|
||||
});
|
||||
},
|
||||
add: function(data){
|
||||
for(let i = 0, len = data.length; i < len; i++){
|
||||
lib.add(i, data[i]);
|
||||
}
|
||||
},
|
||||
query: function(query){
|
||||
return lib.search(query, { suggest: true });
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user