Git Product home page Git Product logo

Comments (4)

Windyo avatar Windyo commented on August 28, 2024

I've scratched my head a bit concerning this question and it seems to me that it's not doable for now.

olivernn/lunr.js#200
olivernn/lunr.js#97

To sum it up :

  • lunr stems the words in the document
  • returning a match or highlighting it will in fact be based on the stemmed token, not the searched word
  • apart from the token itself, lunr stores no information about the search.

Tagged as won't do while waiting for new devlopments on this issue.

from ghosthunter.

jakeywan avatar jakeywan commented on August 28, 2024

This seems like a pretty useful feature, and I don't think you'd need to rely on lunr to do it. Couldn't you just do this in the callback? Take the returned values, take the current input value, and then wrap where the matching substring in <b> tags?

Unless you see an obvious problem with this method, I'm gonna give it a try and get back to you. I think this is pretty straightforward if you just rely on the callback (performance could be an issue, but we'll see).

from ghosthunter.

Windyo avatar Windyo commented on August 28, 2024

Hey,
you're more than welcome to give it a try :)
If you have any progress on this let me know.

Cheers

from ghosthunter.

magnusarinell avatar magnusarinell commented on August 28, 2024

Would be nice.
Cheers

from ghosthunter.

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.