Open figelwump opened 4 years ago
Looking at the typings for elasticlunr it looks like there's a constructor argument that determines what strings are valid to pass to this.addField
.
So to fix your problem:
interface Foo {
url: string;
}
let elasticLunrIndex = elasticlunr<Foo>(function () {
this.addField('url');
});
Also check out a more relaxed approach here
I'm using elasticlunr in a typescript project. I get the following typescript compiler error when using addField:
The code:
I made sure all
strict
checking is turned off intsconfig.json
. I can workaround it for now by casting the string tonever
(whatever that means) like so: