1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-08-25 23:06:41 +02:00

fix document.searchCache()

This commit is contained in:
Thomas Wilkerling
2025-04-13 15:44:20 +02:00
parent 97e7a44e1b
commit 952b92a80b
27 changed files with 419 additions and 523 deletions

View File

@@ -12,6 +12,18 @@ const Charset = _Charset || (await import("../src/charset.js")).default;
describe("Encoder", function(){
it("Should have been properly normalized", function(){
const index = new Index();
expect(index.encoder.normalize).to.equal(true);
index.add(1, "La Bamba");
index.add(2, "La Bohème");
expect(index.search("la boheme")).to.eql([2]);
expect(index.search("la boheme", { suggest: true })).to.eql([2, 1]);
});
it("Should have been properly added a custom encoder", function(){
const encode = str => str.toLowerCase().split(/\s+/);