const FlexSearch = require("flexsearch@0.7.31")
const index = new FlexSearch.Index({
encode: "simple",
});
index.add(0, "Lorem ipsum dolor sit amet.");
This resulted in an error:
TypeError: this.encode is not a function
at t.add in flexsearch@0.7.31/dist/flexsearch/bundle.js — line 12
The "Index Options" section in the README.md has this as Values for
encode
Option:Reading this, I thought that we can set
false
, one of the strings, or a function as theencode
option.However, setting
false
worked, but setting strings didn't work.I tried this code on RunKit:
This resulted in an error: