elasticlunr.js
elasticlunr.js copied to clipboard
TypeError: lunr.generateStopWordFilter is not a function :When using lunr-languages
##Here is my code const elasticLunr = require('elasticlunr'); require('lunr-languages/lunr.stemmer.support')(elasticLunr) require('lunr-languages/lunr.fr')(elasticLunr);
let index = elasticLunr(function () { this.use(elasticLunr.fr); this.addField('title'); this.addField('body'); });
index.addDoc(data); console.log(index.search('recueille les informaions'));
I get this error when i want to integrate lunr-languages, Please help
Hi there @uvuwuewuewue
I guess you use the wrong language-package. Take this one: https://github.com/weixsong/lunr-languages I ran into the same error.
Not sure, but there seems to be some differences in lunr and elasticlunr implementation. The one you are referring to is compatible with only lunr.
Indeed, thanks for the help :+1:
Thanks @ToLuSt !
Just in case somebody else using npm runs into this issue in the future, this didn't work for me:
npm install lunr-languages
This did work:
npm install git+https://github.com/weixsong/lunr-languages.git
The link to https://github.com/weixsong/lunr-languages is broken!
I then used https://github.com/MihaiValentin/lunr-languages and now I get the same error...
The link to https://github.com/weixsong/lunr-languages is broken!
I then used https://github.com/MihaiValentin/lunr-languages and now I get the same error...
I got the same error again.
The link to https://github.com/weixsong/lunr-languages is broken!
I then used https://github.com/MihaiValentin/lunr-languages and now I get the same error...
I've got the same error too.
HELP~. I'm confused in which lunr-languages module below is for Elasticlunr ?
https://github.com/weixsong/lunr-languages OR https://github.com/MihaiValentin/lunr-languages
Since weixsong path is broken, I've try MihaiValentin but not working.
TypeError: lunr.generateStopWordFilter is not a function
at /home/htdocs/apps/Engine/terry_test/node_modules/lunr-languages/lunr.ru.js:387:35
at Object.
Thanks
sorry for the inconvenience, the repo is recovered. https://github.com/weixsong/lunr-languages
@weixsong I am trying to use lunr-language-zh which I think support Chinese with elasticlunr, I ran into this same problems.
Can you help?
Also, why not rename it to elasticlunr-languages? I am new to node, I dont know how to change the package.json of eleventy to use your lunr-language instead of the original one
Thank you