mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-09-08 21:20:41 +02:00
update urls
This commit is contained in:
@@ -8,11 +8,9 @@
|
||||
<h2>Benchmark: flexsearch-0.7.0</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="../../../dist/flexsearch.light.js"></script>
|
||||
<script src="../../../dist/flexsearch.light.min.js"></script>
|
||||
<script type="module">
|
||||
|
||||
//import Index from "../../../src/index.js";
|
||||
//import Document from "../../../src/document.js";
|
||||
import { suite } from "../../bench.js";
|
||||
|
||||
let lib, split = /[^a-z]+/;
|
||||
@@ -20,13 +18,11 @@
|
||||
suite["flexsearch-0.7.0"] = {
|
||||
|
||||
init: function(){
|
||||
|
||||
lib = new FlexSearch.Index({
|
||||
|
||||
encode: str => str.toLowerCase().split(split),
|
||||
tokenize: "strict",
|
||||
resolution: 1,
|
||||
minlength: 3,
|
||||
optimize: false,
|
||||
fastupdate: false,
|
||||
context: {
|
||||
@@ -37,27 +33,20 @@
|
||||
});
|
||||
},
|
||||
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, 9999);
|
||||
},
|
||||
update: function(data){
|
||||
|
||||
for(let i = 0, len = data.length; i < len; i++){
|
||||
|
||||
lib.update(i, data[i]);
|
||||
}
|
||||
},
|
||||
remove: function(data){
|
||||
|
||||
for(let i = 0, len = data.length; i < len; i++){
|
||||
|
||||
lib.remove(i, data[i]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user