slashdotdash / jekyll-lunr-js-search

[UNSUPPORTED] Jekyll + lunr.js = static websites with powerful full-text search using JavaScript
MIT License
549 stars 107 forks source link

Display matching line or context? #79

Closed blay closed 8 years ago

blay commented 9 years ago

This may be outside of the scope of this plugin and more of a feature request, but would it be possible with the current tools set (lunr.js) to display the matching line from the blog post content in the search results or some context around the match (5 words before and after for example).

/Magnus

slashdotdash commented 8 years ago

The lunr.js library doesn't have support for search context. It only returns matching documents and their score.

There's an open issue for exactly that feature for lunr.js, but it doesn't look like it will be implemented.