Hi everyone,
I started using Ghost more than 5 years ago but I only recently wanted to add in search capabilities. I found a lot of resources on this topic, espacially in this really great post: Search for Ghost. But I wasn’t fully happy with what I found… I wanted a solution easy to setup, javascript only (no jQuery), no server-side installation nor extra databases, using the Ghost API v3 and be able to run full-text search (not only title and tags).
So I started working on a dedicated search plugin before I realized that might interest Ghost community. Started two weeks ago, this project finally turned into an open source library: SearchinGhost.
SeachinGhost: A pure javascript, lightweight & in-browser full-text search plugin for Ghost (blog)
In its core, it rely on the Ghost Content API to fetch the data and the FlexSearch library to search through it. I found out that FlexSearch offered the best search result (in my opinion) compared to the others I tested (Lunr.js, minisearch, fuse.js).
If you are curious, here is the project repository: GitHub - gmfmi/searchinGhost: A pure javascript, lightweight & in-browser full-text search plugin for Ghost (blog). I am still looking for code/project reviews. Any idea or recommendation would be more than welcome, even documentation checks are useful! The current version (v0.5.0) can be considered as “release candidate” and I am confident enough to say it is production-ready. I am just waiting for documentation fix/improvement before publishing the v1.0.0. If you like to code, also feel free to contribute :)
If you are more a “show me the result, please!” person, here is the project demo (SearchinGhost | example) and here is the version set into my personnal blog (https://www.backtopack.fr/ - in french).
Also, I really wanted to thanks the GhostHunter and Ghost-search projects! They helped me to stay on the right path at the very beginning and keep everything clean.
Note: because of the COVID situation, I am still locked at home and I started a side project to bring a search bar to any Ghost theme with a “one-click”/no code solution. The idea is to be very (very) easy by being able to install it only from the Ghost admin adding one script from a CDN. Let me know if anyone is interested!