New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in some search queries #40
Comments
Thanks for reporting this error, please let me know what version of lunr you are using (and what version of node). It'd be really useful if you could provide a cut down version of your index and a query that causes the error too. |
lunr.js crashed on exactly the same line of code in my case because my German stop word filter did not filter the empty string. Apparently, the document store contained the empty string token, while the token store did not, leading to the error. Of course, there might be a different cause in tinganho's case. Either way, I might try to find the source of the empty string bug and provide a fix and corresponding test case. |
Adding
fixed it for me. |
Wow, this is an old issue! I've pushed changes now in 0.6.0 that should solve this issue, let me know if you still have issues with the latest version. |
I got this error on some certain search queries
TypeError: Cannot read property 'tf' of undefined at lunr.Index.documentVector (/usr/local/lib/node_modules/grunt-translate/node_modules/lunr/lunr.js:1104:53) at lunr.Index.search (/usr/local/lib/node_modules/grunt-translate/node_modules/lunr/lunr.js:1076:61) at Array.map (native) at lunr.SortedSet.map (/usr/local/lib/node_modules/grunt-translate/node_modules/lunr/lunr.js:574:24) at lunr.Index.search (/usr/local/lib/node_modules/grunt-translate/node_modules/lunr/lunr.js:1075:6) at Search.query (/usr/local/lib/node_modules/grunt-translate/src/modules/search.js:93:24) at module.exports (/usr/local/lib/node_modules/grunt-translate/app/modules/search/searchApi.js:9:21) at callbacks (/usr/local/lib/node_modules/grunt-translate/node_modules/express/lib/router/index.js:161:37) at param (/usr/local/lib/node_modules/grunt-translate/node_modules/express/lib/router/index.js:135:11) at pass (/usr/local/lib/node_modules/grunt-translate/node_modules/express/lib/router/index.js:142:5)
The text was updated successfully, but these errors were encountered: