olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.87k stars 547 forks source link

Link to block in page #444

Closed inwardmovement closed 4 years ago

inwardmovement commented 4 years ago

It would be a better UX if a click on a result linked in the page to the bloc containing the searched term using anchors/IDs, instead of the whole page (the user has to scroll or perform a second search from the browser in order to find the term in the page), and if the term in that page was highlighted (like in the results list).

Do you have any idea of how I can achieve this?

hoelzro commented 4 years ago

@inwardmovement I think this is up to the UI you're using to present your search results - as I mentioned on #445, you would probably do some application-level routing via the URL fragment. This is doable in vanilla JavaScript, but I'm sure the popular frameworks have a way to do this as well!

inwardmovement commented 4 years ago

Ok, thanks!