Comments (4)
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.
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.
Hey,
you're more than welcome to give it a try :)
If you have any progress on this let me know.
Cheers
from ghosthunter.
Would be nice.
Cheers
from ghosthunter.
Related Issues (20)
- Arabic or Persian is not working! HOT 1
- Use result of search as filter of posts.
- Month names are hard-coded in English
- Serialization?
- Subpath bug
- GhostHunter in Nuxt.js
- Archive Repo HOT 4
- Plans to support v2 Content API? HOT 9
- Featured Image support needed. HOT 2
- getting posts url is hardcoded HOT 1
- ghost v3 support HOT 2
- Not working HOT 1
- MOBILE ONLY - Uncaught TypeError: Cannot read property 'query' of null HOT 2
- Fix of pubDate is not in dist version
- Use a tag or create a release when publishing new versions
- total query result are 11 but shows only 2, searching again shows all results HOT 3
- Different results locally and on production
- 2 search forms, 1 result section "Uncaught TypeError: Cannot read property 'query' of undefined" HOT 4
- unable to render {{tag}} in result template
- Sort order
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghosthunter.