Giter VIP home page Giter VIP logo

Comments (5)

olivernn avatar olivernn commented on May 12, 2024

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.

from lunr.js.

severinh avatar severinh commented on May 12, 2024

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.

from lunr.js.

tinganho avatar tinganho commented on May 12, 2024

@severinh and @olivernn I removed this line after this.index.pipeline.remove(lunr.stopWordFilter); creating the index caused this problem. I installed it recently with [email protected]

from lunr.js.

shredding avatar shredding commented on May 12, 2024

Adding

this.pipeline.add(function (token) {
    if (token.length > 0) return token;
})

fixed it for me.

from lunr.js.

olivernn avatar olivernn commented on May 12, 2024

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.

from lunr.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.